Skip to content

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

@eeoam

Description

@eeoam

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions