Parcel: Parcel build does not read .env when enable no-source-map

Created on 15 Jun 2018  路  5Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

In .env I have DOMAIN=mydomain.com
When I run parcel build index.html --target browser --no-source-maps, it generates src.hash.js file.
I run cat dist/src.hash.js | grep mydomain to make sure it builds correctly but nothing returns.
When I remove no-source-maps option it works normally

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.8.1 |
| Node | 6.14.2 |
| npm/Yarn | 1.6.0 |
| Operating System | 16.04 |

Bug Stale

Most helpful comment

In my case, env vars exposing was working great but suddenly stopped, found this issue, tried to add --no-source-maps and it fixed the issue, when I removed --no-source-maps param it still worked...

Looks it's somehow caused by caching, cause deleting .cache folder made it work too.

Another issue https://github.com/parcel-bundler/parcel/issues/1625

All 5 comments

In my case, env vars exposing was working great but suddenly stopped, found this issue, tried to add --no-source-maps and it fixed the issue, when I removed --no-source-maps param it still worked...

Looks it's somehow caused by caching, cause deleting .cache folder made it work too.

Another issue https://github.com/parcel-bundler/parcel/issues/1625

Adding and removing --no-source-maps would cause the options to change, so cache would be invalidated. Resulting in the same effect as clearing the .cache folder.

So this is probably a cache issue as @Strajk discovered

I've just tested again so this is a cache issue. Should I close this ticket now

@minhchu it would still be usefull to fix the cache issue, at least if we can pinpoint when this happens and why

Sent with GitHawk

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings