ITADN

Chapter 8 - Unable to create index.js with spago bundle-app

#474Openeeoam 创建于 2024-11-15
E
eeoamcommented
Ola! I have compiled the code for Chapter 8 with `spago build` successfully, However when I try to create the `index.js` file with `spago bundle-app`, I get the following error: ``` $ spago bundle-app [info] Build succeeded. ✘ [ERROR] Could not resolve "react" output/React.Basic.DOM.Internal/foreign.js:1:18: 1 │ import React from "react"; ╵ ~~~~~~~ You can mark the path "react" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. ✘ [ERROR] Could not resolve "react" output/React.Basic/foreign.js:1:18: 1 │ import React from "react"; ╵ ~~~~~~~ You can mark the path "react" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. ✘ [ERROR] Could not resolve "react-dom" output/React.Basic.DOM/foreign.js:3:21: 3 │ import ReactDOM from "react-dom"; ╵ ~~~~~~~~~~~ You can mark the path "react-dom" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. ✘ [ERROR] Could not resolve "react" output/React.Basic.Hooks/foreign.js:1:18: 1 │ import React from "react"; ╵ ~~~~~~~ You can mark the path "react" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. 4 errors [error] Bundle failed. ``` Can anyone help figure out what's wrong and how to fix this problem?
0 条评论