Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade less to fix a build error #134

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

haacked
Copy link
Contributor

@haacked haacked commented Aug 27, 2020

This fixes a build error on a clean build. Yet another issue with Node 13+.

Here are my repro steps:

  1. Go to the root of the repository
  2. git clean -xdf (or do a clean clone)
  3. cd WebAssets
  4. npm install
  5. npm run-script build
  6. cd ../AspNetCore.Demo
  7. npm install
  8. npm run-script build

EXPECTED: It builds.
ACTUAL: Parser "assets/JSAsset" failed to initialize when processing asset "app.js". Threw the following error:
Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

Require stack: - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/@babel/preset-env/lib/index.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/transforms/babel/env.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/transforms/babel/config.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/transforms/babel/transform.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/assets/JSAsset.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/Parser.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/Bundler.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/index.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/src/cli.js - /Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/parcel/bin/cli.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1014:15) at Function.Module._load (internal/modules/cjs/loader.js:884:27) at Module.require (internal/modules/cjs/loader.js:1074:19) at require (/Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) at Object. (/Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js:10:55) at Module._compile (/Users/haacked/dev/haacked/mirrorsharp/AspNetCore.Demo/node_modules/v8-compile-cache/v8-compile-cache.js:194:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10) at Module.load (internal/modules/cjs/loader.js:1034:32) at Function.Module._load (internal/modules/cjs/loader.js:923:14) at Module.require (internal/modules/cjs/loader.js:1074:19) falling back to RawAsset

It's an issue with Node 13+ and older versions of @babel/preset-env. According to this comment the issue was fixed in Babel and we just need to upgrade the @babel/preset-env package.

This PR upgrades less which brings in the latest version of @babel/preset-env`.

This fixes a build error caused by a conflict with an older version of
@babel/preset-env and Node 13+.

The fix is to upgrade less which brings in the latest version of
@babel/preset-env 7.11.0.
@ashmind
Copy link
Owner

ashmind commented Aug 27, 2020

Sounds good -- thanks! Technically node 13 is not LTS yet so I won't adjust the CI build to use it just yet.
But I am happy to merge in any improvements that work on both 12 and 13.

@ashmind ashmind merged commit 54283cf into ashmind:master Aug 27, 2020
@haacked haacked deleted the fix-babel-build-error branch March 11, 2021 18:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants