Parcel: 馃悰 parcel build fails with UnhandledPromiseRejectionWarning on Netlify

Created on 30 Jan 2018  路  8Comments  路  Source: parcel-bundler/parcel

I think this is actually an issue on Netlify's end as Parcel 1.5.1 works fine on my computer, but this issue doesn't happen with other build systems, so I'm not sure. Their support says they don't have enough time to look into why, but there's a Docker instance that developers can try on.

馃 Expected Behavior

parcel build should function properly and not return an error.

馃槸 Current Behavior

6:17:38 PM: $ parcel build --public-url / index.html
6:17:39 PM: (node:906) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module './SourceMapPackager'
6:17:39 PM: Done in 0.68s.

馃拋 Possible Solution

I'm not sure, it seems that SourceMapPackager was introduced in 1.5. Maybe explicitly add the filename extension? Could it also be different behavior between Node versions? Is there a possibility that filenames containing "SourceMap" are deleted for whatever reason (unlikely but possible)?

馃敠 Context

I'm trying to deploy applications on Netlify with Parcel 1.5 but I can't. Have to downgrade to Parcel 1.4, which does work :(

馃捇 Code Sample

N/A, but this does happen with https://github.com/yunyu/parcel-duplicate-module-reprod

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.5.1
| Node | 6.12.3
| npm/Yarn | yarn 0.18.1 (this also happens with 1.3.2)
| Operating System | Linux x64

Bug Legacy Node Bug

All 8 comments

What Node version / OS is Netlify using behind the scenes?

According to their support and the build logs, it's Node 6.12.3 running on Linux amd64. I've tested on a VPS running Node 8.9.4 and Linux amd64, which doesn't exhibit this issue. I suspect it's them having an improper cleanup mechanism, which is unfortunate (but they're still one of the most convenient ways to deploy frontend projects).

I will be trying this after setting modern Node and yarn versions.

Actually, I set the NODE_VERSION environment variable to v8.9.4 in Netlify's control panel, and the build works now. (I should have tried it first, didn't know until after I filed this issue though).

Should I retitle this to say that it likely fails on v6.12.x? A possible workaround would just be to mention this in the docs, if Parcel doesn't intend to support older LTSes.

Ok ya that seems to be the issue. We currently have some problems with supporting Node 6. It鈥檚 been something that we鈥檝e been working on for a while, and it鈥檚 certainly a priority for us to support older versions, but at the moment we still have some subtle kinks with Node 6 that haven鈥檛 been worked out yet.

For more reference see: #648 #693 #253 #246

I think we should leave this issue open for tracking since this is the first time seeing this error with SourceMapPackager

I see the same with node version v7.10.1 and npm 5.6.0

This is not an issue with SourceMapPackager, it is an issue with node 6 support, node 7 is not supported either.
Parcel is Node 8+
Although we are working on Supporting Node 6 i'll close this issue as progress can be tracked here #253

Yeah, I can confirm that it works with Node 8. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devongovett picture devongovett  路  3Comments

adamreisnz picture adamreisnz  路  3Comments

termhn picture termhn  路  3Comments

Niggler picture Niggler  路  3Comments

philipodev picture philipodev  路  3Comments