Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

client/webserver/site: babel build error #222

Closed
chappjc opened this issue Mar 25, 2020 · 0 comments · Fixed by #223
Closed

client/webserver/site: babel build error #222

chappjc opened this issue Mar 25, 2020 · 0 comments · Fixed by #223

Comments

@chappjc
Copy link
Member

chappjc commented Mar 25, 2020

$   npm --version
6.14.3
$   npm i
...
added 1351 packages from 637 contributors and audited 15266 packages in 14.755s
...
$   npm run build

> [email protected] build /home/jon/github/decred/dcrdex/client/webserver/site
> webpack --config webpack/prod.js --progress --colors

Hash: c1f84cc5149d4000c376
Version: webpack 4.41.5
Time: 1154ms
Built at: 03/25/2020 10:30:57 AM
 2 assets
Entrypoint app = entry.js entry.js.map
[0] ./src/index.js 3.32 KiB {0} [built] [failed] [1 error]

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/helper-compilation-targets/package.json
    at applyExports (internal/modules/cjs/loader.js:524:9)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:661:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:963:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/preset-env/lib/debug.js:8:33)
    at Module._compile (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/preset-env/lib/index.js:11:14)
    at Module._compile (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at requireModule (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/files/plugins.js:165:12)
    at loadPreset (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/files/plugins.js:83:17)
    at createDescriptor (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
    at /home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/config-descriptors.js:109:50
    at Array.map (<anonymous>)
    at createDescriptors (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at /home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/config-descriptors.js:58:104
    at cachedFunction (/home/jon/github/decred/dcrdex/client/webserver/site/node_modules/@babel/core/lib/config/caching.js:62:27)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack --config webpack/prod.js --progress --colors`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jon/.npm/_logs/2020-03-25T15_30_57_807Z-debug.log

It seems to be related to this node change: nodejs/node#31625

However, this is not really reproducible since we do not have package-lock.json checked in, hence the versions are not locked down. On my end, this was fixable by one of:

  • rm -rf node_modules package-lock.json && npm i OR
  • npm up
    Both of these installed newer versions of the dependencies than the minimum versions listed in package.lock. Before trying the above I had:
$   npm out
Package                    Current  Wanted  Latest  Location
@babel/core                  7.8.3   7.9.0   7.9.0  dexclient
@babel/preset-env            7.8.3   7.9.0   7.9.0  dexclient
babel-eslint                10.0.3  10.1.0  10.1.0  dexclient
babel-loader                 8.0.6   8.1.0   8.1.0  dexclient
eslint-config-standard      14.1.0  14.1.1  14.1.1  dexclient
eslint-plugin-import        2.20.0  2.20.1  2.20.1  dexclient
eslint-plugin-react         7.18.0  7.19.0  7.19.0  dexclient
stylelint                   12.0.1  12.0.1  13.2.1  dexclient
stylelint-config-standard   19.0.0  19.0.0  20.0.0  dexclient
stylelint-webpack-plugin     1.2.1   1.2.3   1.2.3  dexclient
terser-webpack-plugin        2.3.2   2.3.5   2.3.5  dexclient
webpack                     4.41.5  4.42.1  4.42.1  dexclient
webpack-bundle-analyzer      3.6.0   3.6.1   3.6.1  dexclient
webpack-cli                 3.3.10  3.3.11  3.3.11  dexclient
webpack-dev-server          3.10.1  3.10.3  3.10.3  dexclient

I briefly searched the babel core and babel loader release notes, but didn't see anything. In any case, we should bump the minimum babel deps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant