0

I run parcel2 build command: parcel build src/web/index.html

and I got the following error

➜ my-webapp git:(master) ✗ npm run build-dev
> [email protected] build-dev
> parcel build src/web/index.html
🚨 Build failed.
@parcel/transformer-js: Expected ',', got '{'
 /Users/me/my-webapp/node_modules/react-native-inappbrowser-reborn/index.js:9:13
 8 | 
 > 9 | import type {
 > | ^
 10 | BrowserResult,
 11 | AuthSessionResult,

Another example:

🚨 Build failed.
@parcel/transformer-js: Expected ',', got ':'
 /Users/me/my-webapp/node_modules/react-native/Libraries/Utilities/binaryToBase64.js:15:29
 14 | 
 > 15 | function binaryToBase64(data: ArrayBuffer | $ArrayBufferView): string {
 > | ^
 16 | if (data instanceof ArrayBuffer) {
 17 | // $FlowFixMe[reassign-const]

My current parcel2 config is:

{
 "extends": [
 "@parcel/config-default"
 ],
 "reporters": [
 "...",
 "parcel-reporter-static-files-copy"
 ],
 "transformers": {
 "*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [
 "@parcel/transformer-babel",
 "@parcel/transformer-js"
 ]
 }
}

Do you have any idea?

asked Feb 12, 2025 at 19:00

1 Answer 1

0

I found my mistake: one of my import line created a but dependency between components. After removing the import line, the build was Ok.

✨ Built in 12.31s
answered Feb 12, 2025 at 22:29
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.