embroider-build / ember-auto-import

Zero config import from npm packages
Other
360 stars 109 forks source link

Upgrade issues #527

Closed billybonks closed 2 years ago

billybonks commented 2 years ago

I am trying to upgrade ember and i keep stumbling on this issue, i am unable to test without auto-import since all of ember is dependent on it.

the branch is publicly available https://github.com/billybonks/radar/compare/upgrade/ember-4.2

The error

$ ember electron
Checking dependencies in electron-app...
⠋ BuildingPackage subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json

Stack Trace and Error Report: /var/folders/44/pxpcxyz1303fzpz39nw6q2c00000gn/T/error.dump.a8b104cbc5891edf717a92e0bd620768.log

the dump

=================================================================================

ENV Summary:

  TIME: Wed Jun 22 2022 19:45:22 GMT+0800 (Singapore Standard Time)
  TITLE: ember
  ARGV:
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node
  - /Users/billybonks/unearthing/electron/electron-test/node_modules/.bin/ember
  - electron
  EXEC_PATH: /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node
  TMPDIR: /var/folders/44/pxpcxyz1303fzpz39nw6q2c00000gn/T
  SHELL: /bin/zsh
  PATH:
  - /var/folders/44/pxpcxyz1303fzpz39nw6q2c00000gn/T/yarn--1655898313092-0.824490685182478
  - /Users/billybonks/unearthing/electron/electron-test/node_modules/.bin
  - /Users/billybonks/.config/yarn/link/node_modules/.bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/libexec/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.yarn/bin
  - /Users/billybonks/.config/yarn/global/node_modules/.bin
  - /Users/billybonks/.rbenv/shims
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin
  - /Users/billybonks/ImageMagick-7.1.0/bin
  - /Applications/Postgres.app/Contents/Versions/latest/bin/
  - /opt/X11/bin
  - usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /Users/billybonks/.rbenv/bin
  - /Users/billybonks/.rbenv/shims
  - /Users/billybonks/unearthing/bin
  - /Applications/Google Chrome.app/Contents/MacOS
  - /usr/local/go/bin
  - /Users/billybonks/.asdf/shims
  - /Users/billybonks/.asdf/bin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /Library/Apple/usr/bin
  PLATFORM: darwin x64
  FREEMEM: 846553088
  TOTALMEM: 17179869184
  UPTIME: 1026356
  LOADAVG: 5.98193359375,5.31640625,5.27978515625
  CPUS:
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.18.1
  - brotli: 1.0.9
  - cldr: 39.0
  - icu: 69.1
  - llhttp: 6.0.4
  - modules: 93
  - napi: 8
  - nghttp2: 1.45.1
  - nghttp3: 0.1.0-DEV
  - ngtcp2: 0.1.0-DEV
  - node: 16.13.1
  - openssl: 1.1.1l+quic
  - tz: 2021a
  - unicode: 13.0
  - uv: 1.42.0
  - v8: 9.4.146.24-node.14
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: ERR_PACKAGE_PATH_NOT_EXPORTED
  - codeFrame: [undefined]
  - errorMessage: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at MacrosConfig.babelPluginConfig (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/macros-config.ts:366:17)
    at Class.installBabelPlugin (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/ember-addon-main.ts:74:60)
    at Class.included (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/ember-addon-main.ts:43:10)
    at Class.superWrapper [as included] (/Users/billybonks/unearthing/electron/electron-test/node_modules/core-object/lib/assign-properties.js:34:20)
    at /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:497:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:494:24)
    at Class.included (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:769:10)
    at Class.superWrapper [as included] (/Users/billybonks/unearthing/electron/electron-test/node_modules/core-object/lib/assign-properties.js:34:20)

=================================================================================

thanks for your effort and appreciate the help

runspired commented 2 years ago

i am unable to test without auto-import since all of ember data is dependent on it

mind specifying what you mean by this?

I am trying to upgrade ember and i keep stumbling on this issue

Best I can tell from your stack trace, this is probably a bug with cjs/esm interop when using this package that hasn't been updated in 9 years: https://github.com/kamicane/require-relative

billybonks commented 2 years ago

Thanks for the hint, seems like that module is being required by broccoli-rollup v2 which is being depended on by ember-fetch ill play aorund with resolutions and see if it can be resolved.

as for the ember data comment. when i remove auto-import i get the following error

image
runspired commented 2 years ago

@billybonks notice that both ember-source and ember-qunit are in that list too. The reason I found the comment surprising is it's a required part of ember-cli and any addon at this point.

billybonks commented 2 years ago

That is a fair point, i didn't read all the addons that required it, i updated the comment accordingly.

billybonks commented 2 years ago

Removed require relative but the issue still persists

https://github.com/billybonks/radar/compare/upgrade/ember-4.2

=================================================================================

ENV Summary:

  TIME: Sat Jul 30 2022 00:33:18 GMT+0800 (Singapore Standard Time)
  TITLE: ember
  ARGV:
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node
  - /Users/billybonks/unearthing/electron/electron-test/node_modules/.bin/ember
  - electron
  EXEC_PATH: /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node
  TMPDIR: /var/folders/44/pxpcxyz1303fzpz39nw6q2c00000gn/T
  SHELL: /bin/zsh
  PATH:
  - /var/folders/44/pxpcxyz1303fzpz39nw6q2c00000gn/T/yarn--1659112386821-0.7712983983078505
  - /Users/billybonks/unearthing/electron/electron-test/node_modules/.bin
  - /Users/billybonks/.config/yarn/link/node_modules/.bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/libexec/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/lib/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin/node_modules/npm/bin/node-gyp-bin
  - /Users/billybonks/.yarn/bin
  - /Users/billybonks/.config/yarn/global/node_modules/.bin
  - /Users/billybonks/.rbenv/shims
  - /Users/billybonks/.nvm/versions/node/v16.13.1/bin
  - /Users/billybonks/ImageMagick-7.1.0/bin
  - /Applications/Postgres.app/Contents/Versions/latest/bin/
  - /opt/X11/bin
  - /Users/billybonks/.rbenv/bin
  - /Users/billybonks/.rbenv/shims
  - /Users/billybonks/unearthing/bin
  - /Applications/Google Chrome.app/Contents/MacOS
  - /usr/local/go/bin
  - usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /Users/billybonks/.asdf/shims
  - /Users/billybonks/.asdf/bin
  - /usr/local/bin
  - /usr/bin
  - /bin
  - /usr/sbin
  - /sbin
  - /Library/Apple/usr/bin
  - /Users/billybonks/Library/Python/3.8/bin
  - /Users/billybonks/.local/bin
  - /Users/billybonks/Library/Python/3.8/bin
  - /Users/billybonks/.local/bin
  PLATFORM: darwin x64
  FREEMEM: 1525948416
  TOTALMEM: 17179869184
  UPTIME: 2271763
  LOADAVG: 15.84033203125,11.4453125,9.95849609375
  CPUS:
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz - 2600
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.18.1
  - brotli: 1.0.9
  - cldr: 39.0
  - icu: 69.1
  - llhttp: 6.0.4
  - modules: 93
  - napi: 8
  - nghttp2: 1.45.1
  - nghttp3: 0.1.0-DEV
  - ngtcp2: 0.1.0-DEV
  - node: 16.13.1
  - openssl: 1.1.1l+quic
  - tz: 2021a
  - unicode: 13.0
  - uv: 1.42.0
  - v8: 9.4.146.24-node.14
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: ERR_PACKAGE_PATH_NOT_EXPORTED
  - codeFrame: [undefined]
  - errorMessage: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './src/babel-plugin-cache-busting.js' is not defined by "exports" in /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/shared-internals/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at MacrosConfig.babelPluginConfig (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/macros-config.js:289:25)
    at Class.installBabelPlugin (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/ember-addon-main.js:74:66)
    at Class.included (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-auto-import/node_modules/@embroider/macros/src/ember-addon-main.js:44:14)
    at Class.superWrapper [as included] (/Users/billybonks/unearthing/electron/electron-test/node_modules/core-object/lib/assign-properties.js:34:20)
    at /Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:497:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:494:24)
    at Class.included (/Users/billybonks/unearthing/electron/electron-test/node_modules/ember-cli/lib/models/addon.js:769:10)
    at Class.superWrapper [as included] (/Users/billybonks/unearthing/electron/electron-test/node_modules/core-object/lib/assign-properties.js:34:20)

=================================================================================
billybonks commented 2 years ago

anyways i have managed to solve with

  "resolutions": {
    "ember-auto-import": "2.4.2", ---- ember qunit
    "broccoli-rollup": "5.0.0" ---- ember fetch
  }
    "@babel/helper-get-function-arity": "^7.16.7", --- not sure why this is missing

and upgrading things in an order that i forgot. Thanks for your help @runspired