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
Aron
1,3022 gold badges18 silver badges31 bronze badges
1 Answer 1
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
Aron
1,3022 gold badges18 silver badges31 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-js