You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After initializing a new component with the following options:
Scaffold a new project
Application
Linting (eslint & prettier)
Testing (web-test-runner)
Demoing (storybook)
Typescript
npm
and running npm run storybook, the following error is thrown:
interneuron:st-app kito$ npm run storybook
>[email protected] storybook
> tsc && npm run analyze -- --exclude dist && concurrently -k -r "tsc --watch --preserveWatchOutput""wds -c .storybook/server.mjs">[email protected] analyze
> cem analyze --litelement --exclude dist
[11:38:31 PM] @custom-elements-manifest/analyzer: Created new manifest.
[11:38:31 PM] Starting compilation in watch mode...
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/.storybook/main.js from /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/shared/config/readStorybookConfig.js not supported.
main.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs"in /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at Object.readStorybookConfig (/Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/shared/config/readStorybookConfig.js:56:35)
at storybookPlugin (/Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/serve/storybookPlugin.js:16:51)
at file:///Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/.storybook/server.mjs:7:13 {
code: 'ERR_REQUIRE_ESM'
}
After initializing a new component with the following options:
Scaffold a new project
Application
Linting (eslint & prettier)
Testing (web-test-runner)
Demoing (storybook)
Typescript
npm
and running npm run storybook, the following error is thrown:
This is potentially related to #87.
The text was updated successfully, but these errors were encountered: