Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parcel error when running example #1060

Open
jckr opened this issue Jul 14, 2021 · 0 comments · May be fixed by #1061
Open

parcel error when running example #1060

jckr opened this issue Jul 14, 2021 · 0 comments · May be fixed by #1061
Labels
scope: templates Related to an init template, not necessarily to core (but could influence core)

Comments

@jckr
Copy link

jckr commented Jul 14, 2021

Current Behavior

going into an example folder, and starting the project ie with npm run start, gets this error:
@parcel/transformer-js: Browser scripts cannot have imports or exports.

Expected behavior

The build succeeds

Suggested solution(s)

In the index.html template, adding type="module" to the script tag that loads index.tsx does the trick.

Additional context

Your environment

System:
    OS: macOS 11.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 192.52 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.4.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.18.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 91.0.4472.114
    Chrome Canary: 93.0.4575.0
    Safari: 14.1.1
  npmPackages:
    typescript: ^3.4.5 => 3.9.10 
  npmGlobalPackages:
    typescript: 4.3.5
jckr added a commit to jckr/tsdx that referenced this issue Jul 14, 2021
@agilgur5 agilgur5 added the scope: templates Related to an init template, not necessarily to core (but could influence core) label Apr 11, 2022
@agilgur5 agilgur5 linked a pull request Apr 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: templates Related to an init template, not necessarily to core (but could influence core)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants