await import causing error #15578
-
Hello, const { myFunc } = await import("./file");
export default function Main() {
const content = myFunc();
return <div>content</div>;
} This throws
In my next.js file, I have
Versions:
Any help is appriciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hello! I wanna know as to what |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Here is an example of what I am trying to do. When running with a standalone webpack, this works. I will try to add that to the example as well. |
Beta Was this translation helpful? Give feedback.
-
I used react |
Beta Was this translation helpful? Give feedback.
I used react
Context
to solve this.Use
useEffect
to load wasm module and set it as value toProvider
then usinguseContext
to get the wasm functions in components.