Closed Jancat closed 6 years ago
Is this error reproducable? Not sure why this is happening? Could you make a reproducable example repository?
Unknown error
is a bit vague to resolve into an actual cause
The demo repository is here https://github.com/Jancat/parcel-vue-ts-demo.
Because of the issue of parcel build
, I had to import vue-cli
to build the dist.
@DeMoorJasper I'm getting the same error and found this when trying to figure out why.
Also, I'm not using TypeScript at all.
@andrewbanchich Unknown error can pretty much be everything but I'll look into it when I find the time
This is a fairly strange error, for some reason it throws a string instead of an error somewhere. This is the real error message:
Error: Error: Error: Cannot find source file "/Users/demoor/Documents/parcel-vue-ts-demo/src/views/product/ProductList.vue"
at TypeScriptCompiler.compile (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/parcel-plugin-typescript/build/backend/compiler/tsc.js:24:19)
at Object.<anonymous> (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/parcel-plugin-typescript/build/backend/worker/launcher.js:28:29)
at Generator.next (<anonymous>)
at fulfilled (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/tslib/tslib.js:104:62)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at TypeScriptWorker.<anonymous> (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/parcel-plugin-typescript/build/backend/ipc/worker/index.js:27:19)
at Generator.next (<anonymous>)
at fulfilled (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/tslib/tslib.js:104:62)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at IncomingMessage.res.setEncoding.on (/Users/demoor/Documents/parcel-vue-ts-demo/node_modules/parcel-plugin-typescript/build/backend/ipc/client.js:31:32)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
How can I see the "real" error message?
I only get this when building Vue as well, but when I serve it for dev it is totally fine. I just finished porting all the code from Webpack to Parcel, so it would be helpful if I had a way to find out where this error is actually originating.
I got it working. I think it was related to #1124 , since I eventually got it to display a real error message.
@andrewbanchich I opened a PR that fixes this issue, like mentioned above. #1761
@DeMoorJasper Could you tell me how to fix the error that Cannot find source file? I had imported parcel-plugin-typescript
to configure baseUrl and paths in tsconfig.json.
And it works fine on parcel public/index.html
except throw the error UnhandledPromiseRejectionWarning: Error: Error: Error: Could not find file: xxx
.
Probably best to report it to parcel-plugin-ts
Sent with GitHawk
🐛 bug report
I'm building a vue application with typescript. There is normal when running
parcel index.html
, but error was thrown inparcel build index.html
🎛 Configuration (.babelrc, package.json, cli command)
tsconfig.json
package.json
🤔 Expected Behavior
parcel build index.html
successfully outputdist
directory😯 Current Behavior
When execute
NODE_ENV=production parcel build index.html
andparcel build index.html
, the error was thrown:parcel build index.html
works normally. So is theNODE_ENV=production
makes the error?I debug the
https://github.com/parcel-bundler/parcel/blob/2e1ffc65c793a9d391a483ba43dea7962880f40c/src/workerfarm/Worker.js#L142
and log the
call
error info:💁 Possible Solution
🔦 Context
💻 Code Sample
🌍 Your Environment