Skip to content

Using storybook reports error Must use import to load ES Module #2803

Answered by DanaCoding
DanaCoding asked this question in Q&A
Discussion options

You must be logged in to vote

It works for me, many thx😀

.storybook create package.json

{"type":"commonjs"}

.storybook/main.js

module.exports = {
 ... ...

  "svelteOptions": {
     - "preprocess": require("../svelte.config.js").preprocess
     + "preprocess": import("../svelte.config.js").preprocess
  }
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@martaver
Comment options

Answer selected by bluwy
Comment options

You must be logged in to vote
1 reply
@benbender
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2801 on November 15, 2021 02:27.