RafidMuhymin/astro-imagetools

Named export 'findUp' not found. The requested module 'find-up' is a CommonJS module

Opened this issue · 2 comments

every time I try to build my astro site I get this error:

file:///C:/MySoftwareProjects/astro-test/dist/entry.mjs?time=1666123020542:10
import { findUp } from 'find-up';
         ^^^^^^
SyntaxError: Named export 'findUp' not found. The requested module 'find-up' is a CommonJS module, which may not support all module.exports as named exports.    
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'find-up';
const { findUp } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:528:24)
    at async generatePages (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/core/build/generate.js:71:20)
    at async staticBuild (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/core/build/static-build.js:68:5)
    at async AstroBuilder.build (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/core/build/index.js:86:5)
    at async AstroBuilder.run (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/core/build/index.js:127:7)
    at async build (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/core/build/index.js:22:3)
    at async runCommand (file:///C:/MySoftwareProjects/astro-test/node_modules/astro/dist/cli/index.js:190:14)

Can someone tell me how to fix this?

I have the same issue

I ended up adding find-up to my devDependencies and that seemed to fix it as a temp work around.

// package.json
"devDependencies": {
   "find-up": "^6.3.0",