I have a problem running an older Project of my collegue (last successful run in December 2021).
package.json we had declared:
running it now (February 2022), it automatically adds in the following line:
and with that, it ran into an error:
× Build failed.
@parcel/transformer-js: Browser scripts cannot have imports or exports.
i tried removing the
But that leads into the same error.
Is the error even about the version of parcel,
or could it be something completely different?
As mentioned, in december everything worked fine.
Now that i cloned the Git-Repo and installed the npm to my clone of the project it gets the error.
Depending on tags like
next does create these situations where the build stops working, this is an unfortunate fact of the npm ecosystem. There are two ways to proceed as far as I can see: you can use
npm ci instead of
npm install on a fresh checkout of your colleague’s
package-lock.json to try and get the same result they did last December. If that works, you can note down the chosen
parcel version and place that in your devDependencies instead of
next. The other way is to perform the migration to Parcel v2. It looks like the issue you’re currently encountering is discussed in the migration guide.
I could solve it this way:
I went back to
npm audit fix
and changed all –dist-dir to –out-dir:
"ui:bde-terminal:start": "parcel serve src/bde-terminal/public/index.html --out-dir build/bde-terminal/debug --port 1234 --host localhost",
It is not the ideal way. But I haven’t seen any issues so far.
Great to hear! Looks reasonable to me.