Closed altano closed 3 years ago
i have the same problem
Same issue
What operating system are you using? Window here
import {rollup} from "rollup"; ^^^^^^ SyntaxError: Named export 'rollup' not found. The requested module 'rollup' 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 'rollup'; const {rollup} = pkg;
This could be the reason: https://github.com/rollup/rollup/issues/4253
@matthewp rolling back to rollup@2.58.0
addressed the missing export issue, but led to the following error:
<path-to-project>/node_modules/.pnpm/@astrojs+language-server@0.7.19/node_modules/@astrojs/language-server/dist/check.js:46
text: this.docManager.get(uri)?.getText() || '',
SyntaxError: Unexpected token '.'
rollup@2.58.3
works great
~but again @astrojs/language-server
is the problem: the optional chaining and nullish coalescing operators are triggering syntax errors~
Turns out I hadn't understood Volta manages dependencies: despite running node@16
, the fact that I had installed pnpm
under node@12
meant that this was the version of node used when runnning pnpx astro check
So alls good now?
Sorry... yes!
Can confirm that using rollup@2.58.3
addresses the issue 👍
I appreciate the workaround but shouldn’t astro itself update the dependency as well? https://github.com/snowpackjs/astro/blob/059aff923b27b7758fc4daffdc1b2506b6fb0a8c/packages/astro/package.json#L92
I had the same issue for find-up
(using Astro version 1.3.0
on MacOS)
npm install find-up
(to version 6.3.0
) fixed it ... but ...npm install
again to get rid of some local conflicting versions. Unfortunately I can't reproduce it anymore but I am still gonna post this if somebody else discovers the same issue.Update: OK, it happened again at the step generating static routes
(even after deleting node_modules and running npm install):
I have the same problem with the Vue3Marquee
Using Astro 1.6.0
Here is the console output:
$ npm run build
> @example/minimal@0.0.1 build
> astro build
16:38:00 [build] output target: static
16:38:00 [build] Collecting build info...
16:38:00 [build] Completed in 12ms.
16:38:00 [build] Building static entrypoints...
16:38:02 [build] Completed in 1.28s.
building client
Completed in 683ms.
generating static routes
error Named export 'Vue3Marquee' not found. The requested module 'vue3-marquee' 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 'vue3-marquee';
const { Vue3Marquee } = pkg;
File:
file
Stacktrace:
file:///home/***/dist/entry.mjs?time=1668584282824:4
/* empty css */import { Vue3Marquee } from 'vue3-marquee';
^^^^^^^^^^^
SyntaxError: Named export 'Vue3Marquee' not found. The requested module 'vue3-marquee' 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 'vue3-marquee';
const { Vue3Marquee } = 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:526:24)
at async generatePages (file:///home/***/node_modules/astro/dist/core/build/generate.js:53:20)
at async staticBuild (file:///home/***/node_modules/astro/dist/core/build/static-build.js:70:5)
at async AstroBuilder.build (file:///home/***/node_modules/astro/dist/core/build/index.js:87:5)
at async AstroBuilder.run (file:///home/***/node_modules/astro/dist/core/build/index.js:128:7)
at async build (file:///home/***/node_modules/astro/dist/core/build/index.js:22:3)
at async runCommand (file:///home/***/node_modules/astro/dist/cli/index.js:191:14)
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
When creating a
blog
starter usingnpm init astro
I get a site that won't run.npm run dev
gives me the error:Steps to Reproduce
(using node v17.0.1)
npm init astro
using templateblog
npm i
npm run dev
Link to Minimal Reproducible Example (Optional)
No response