You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Parcel 2.2.0 with a single HTML file with an inline script, Parcel incorrectly identifies a destructuring assignment as some sort of module, triggering the error: @parcel/transformer-js: Browser scripts cannot have imports or exports. when running parcel build.
Writing this will trigger the error in an inline script block:
The inline script, that does not use any modules, should build as expected.
馃槸 Current Behavior
Parcel incorrectly declares that I'm using a module when I attempt to build the package:
馃毃 Build failed.
@parcel/transformer-js: Browser scripts cannot have imports or exports.
/home/user/furryfont/index.html:81:1
80 |
> 81 | <script>
> | ^
82 | function render_editor() {
83 | window.quill = new Quill('#editor', {
馃挕 Add the type="module" attribute to the <script> tag.
馃摑 Learn more: https://parceljs.org/languages/javascript/#classic-scripts
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
馃敠 Context
This was frustrating as I needed to go through my last commit line by line to see what was causing the build system to fail. I knew I hadn't used an import, so the error caught me offguard.
馃悰 bug report
When using Parcel 2.2.0 with a single HTML file with an inline script, Parcel incorrectly identifies a destructuring assignment as some sort of module, triggering the error:
@parcel/transformer-js: Browser scripts cannot have imports or exports.
when runningparcel build
.Writing this will trigger the error in an inline script block:
However, writing this does not:
馃帥 Configuration (.babelrc, package.json, cli command)
Package json:
馃 Expected Behavior
The inline script, that does not use any modules, should build as expected.
馃槸 Current Behavior
Parcel incorrectly declares that I'm using a module when I attempt to build the package:
馃敠 Context
This was frustrating as I needed to go through my last commit line by line to see what was causing the build system to fail. I knew I hadn't used an import, so the error caught me offguard.
馃捇 Code Sample
You can view my code here: https://github.com/an0nusr/furryfont/commits/main
The issue began when I introduced the destructuring assignment in commit 9df206bc65b559d8326f5263d66f3b4e1cbdac23.
It resolved when I rewrote the line in commit: 7e279a691c8faeeaac536debf3557b1ec838322c
馃實 Your Environment
The text was updated successfully, but these errors were encountered: