Parcel 2: Expected constructor errors when building or watching
See original GitHub issueExpected constructor
errors when building or watching
🎛 Configuration (.babelrc, package.json, cli command)
package.json
"babel-eslint": "10.0.1",
"babel-preset-airbnb": "3.2.0",
"babel-loader": "8.0.5",
"babel-plugin-lodash": "3.3.4",
"parcel": "2.0.0-alpha.1.1",
// ...
"browser": "target/assets/main.js",
"scripts": {
"dev": "parcel watch app/assets/js/main.js",
"build": "parcel build app/assets/js/main.js",
}
babel.config.js
module.exports = function(api) {
// Cache results until NODE_ENV changes
api.cache.using(() => process.env.NODE_ENV);
return {
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-syntax-dynamic-import", "lodash"]
};
};
🤔 Expected Behavior
Build happens successfully
😯 Current Behavior
➜ play-app-template git:(feature/parcel) ✗ npm run build
> APP_NAME@1.0.0-SNAPSHOT build /home/adamwilliams/Documents/Projects/play-app-template
> parcel build app/assets/js/main.js
/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:197
throw new Error(`Expected constructor ${value.$$type} to be registered with serializer to deserialize`);
^
Error: Expected constructor 2.0.0-alpha.1.1:NodeFS to be registered with serializer to deserialize
at value (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:197:15)
at memoizedFn (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:83:13)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:112:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:138:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:197
throw new Error(`Expected constructor ${value.$$type} to be registered with serializer to deserialize`);
^
Error: Expected constructor 2.0.0-alpha.1.1:NodeFS to be registered with serializer to deserialize
at value (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:197:15)
at memoizedFn (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:83:13)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:112:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:138:9)
at processKey (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:108:20)
at walk (/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:146:9)
/home/adamwilliams/Documents/Projects/play-app-template/node_modules/@parcel/core/node_modules/@parcel/utils/lib/serializer.js:197
throw new Error(`Expected constructor ${value.$$type} to be registered with serializer to deserialize`);
🔦 Context
Can’t use Parcel.
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0-alpha.1.1 |
Node | v10.15.2 |
npm/Yarn | 6.10.3 |
Operating System | Ubuntu 19.04 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Migration - Parcel
The first thing to note when upgrading from Parcel 1 to Parcel 2 is that the npm package name has changed from parcel-bundler...
Read more >Recently Active 'parceljs' Questions - Stack Overflow
I learning JavaScript, and I trying to use Parcel and separate my code with MVC architecture. I have problem with import class from...
Read more >rollup.js
As you build more complex bundles, you'll often need more flexibility – importing modules installed with NPM, compiling code with Babel, working with...
Read more >Parcelable - Android Developers
MloLink, Data structure class representing a Wi-Fi Multi-Link Operation (MLO) link ... class MyParcelable private constructor(`in`: Parcel) : Parcelable {
Read more >react-hot-loader - npm
React-Hot-Loader is expected to be replaced by React Fast Refresh. ... React Native - supports Fast Refresh since 0.61. parcel 2 - supports ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve updated to latest parcel2 and am trying to build but have a lot of babel issues to work through…I’ll try to come back to this over the next few days.
Interesting - I have been using
npm
and the result seems to be different when usingyarn
- It looks like the reporter was also usingnpm
- I will play around with this a little today.