Parcel development server using programmatic API works on v1.x but not on v2.x
See original GitHub issue🐛 bug report
Parcel development server using programmatic API works on v1.x but not on v2.x
🎛 Configuration (.babelrc, package.json, cli command)
No .babelrc
No CLI command
package.json
:
{
"dependencies": {
"@parcel/config-default": "^2.0.0-alpha.3",
"@parcel/core": "^2.0.0-alpha.3",
"vue": "^2.6.11"
}
}
🤔 Expected Behavior
The development server should run properly in v2.x just like in v1.x
😯 Current Behavior
The development server doesn’t run properly in v2.x just like in v1.x
Here is the output :
Server running at http://localhost:5492
√ Built in 7.01s.
× console: (node:7944) UnhandledPromiseRejectionWarning: AssertionError [ERRASSERTION]: The expression evaluated to a falsy value:
(0, assert.default)(server != null)
at Object.report (D:\Documents\GitHub\vue-parcel\nodemodules\@parcel\reporter-dev-server\lib\ServerReporter.js:70:29)
at ReporterRunner.report (D:\Documents\GitHub\vue-parcel\nodemodules\@parcel\core\lib\ReporterRunner.js:69:31)
at process.tickCallback (internal/process/nexttick.js:68:7)
× console: (node:7944) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
× console: (node:7944) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
💁 Possible Solution
The problem seem related to that file : https://github.com/parcel-bundler/parcel/blob/v2/packages/reporters/dev-server/src/ServerReporter.js
🔦 Context
I’m trying to create a Vue.JS project in the most basic way possible.
I chose Parcel as bundler because it truly works with zero-config, and fastly.
My real configuration is inside an Electron instance but I promise this is absolutely irrelevant, proof with what follows.
💻 Code Sample
You can find a full demonstration on this repository : https://github.com/KaKi87/vue-parcel
Please look at the parcel-v1
branch to see the working example then look at the parcel-v2
branch wich is a port of the v1.x configuration for v2.x, nothing less, nothing more, but which doesn’t work.
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0 alpha 3 |
Node | 10.16 |
Yarn | 1.16 |
Operating System | Win10 19041.1 |
I pledge to become a backer if I succeed publishing my project using Parcel v2.x within next week. My project used to work in Parcel v1.x except zero-config support for async/await, which, from what I’ve been told, works in v2.x, implying that it’s a wontfix for 1.x
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
disableCache
andserve.host
can also be omitted.The only thing irritating here (in my opinion) is that the default config does not know its location. I may open a PR for that 😃
The API is only meant for advanced usage like mentioned you should use the cli for normal usage and yes vue isn’t supported but we have a seperate dedicated issue tracking that.
We’re always open to an RFC on how we could improve the API as I also mentioned