adopted-ember-addons / ember-paper

The Ember approach to Material Design.
https://ember-paper.netlify.app/
MIT License
888 stars 333 forks source link

[Embroider:MacrosConfig] the given config from '.../ember-get-config' for packageName 'undefined' is not JSON serializable. #1210

Closed veelenga closed 2 years ago

veelenga commented 2 years ago

We are running ember 3.20. Having this issue while upgrading ember-paper 1.0.0-beta.26 -> 1.0.0-beta.36

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

ENV Summary:

  TIME: Mon Feb 14 2022 10:24:38 GMT+0200 (Eastern European Standard Time)
  TITLE: ember
  ARGV:
  - ~/.nvm/versions/node/v14.18.1/bin/node
  - myapp/node_modules/.bin/ember
  - serve
  TMPDIR: /var/folders/rt/3thkvgpd4jd0gbr1q_j_f0r00000gn/T
  SHELL: /bin/zsh
  PLATFORM: darwin arm64
  FREEMEM: 197656576
  TOTALMEM: 17179869184
  UPTIME: 3537012
  LOADAVG: 15.4306640625,16.673828125,14.9404296875
  CPUS:
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  - Apple M1 - 24
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.17.2
  - brotli: 1.0.9
  - cldr: 39.0
  - icu: 69.1
  - llhttp: 2.1.4
  - modules: 83
  - napi: 8
  - nghttp2: 1.42.0
  - node: 14.18.1
  - openssl: 1.1.1l
  - tz: 2021a
  - unicode: 13.0
  - uv: 1.42.0
  - v8: 8.4.371.23-node.84
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: [undefined]
  - codeFrame: [undefined]
  - errorMessage: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-paper/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable.
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-paper/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable.
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-paper/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable.
    at MacrosConfig.internalSetConfig (myapp/node_modules/ember-paper/node_modules/@embroider/macros/src/macros-config.js:163:19)
    at MacrosConfig.setOwnConfig (myapp/node_modules/ember-paper/node_modules/@embroider/macros/src/macros-config.js:142:21)
    at Class.included (myapp/node_modules/ember-paper/node_modules/@embroider/macros/src/ember-addon-main.js:25:26)
    at Class.superWrapper [as included] (myapp/node_modules/core-object/lib/assign-properties.js:34:20)
    at myapp/node_modules/ember-cli/lib/models/addon.js:497:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (myapp/node_modules/ember-cli/lib/models/addon.js:494:24)
    at Class.included (myapp/node_modules/ember-cli/lib/models/addon.js:769:10)
    at Class.superWrapper [as included] (myapp/node_modules/core-object/lib/assign-properties.js:34:20)
    at Class.included (myapp/node_modules/ember-paper/node_modules/ember-basic-dropdown/node_modules/ember-get-config/index.js:29:26)

=================================================================================
Subtletree commented 2 years ago

What version ember-basic-dropdown are you running?

They updated 5 days ago to 4.0.4 with changelog: [FEATURE] Improve compatibility with Embroider/Ember 4.

If you're not at 4.0.4 then could try that, or if you are then you could try pinning to 4.0.3.

I'm not well versed in the embroider world but possible resources to help fix later: https://github.com/embroider-build/embroider/issues/1077 https://github.com/embroider-build/embroider/pull/1083

Subtletree commented 2 years ago

Looks like it might be this https://github.com/embroider-build/embroider/issues/1077#issuecomment-1016689755

As per that comment, overriding @embroider/* packages to v1.0.0 might fix the problem until the above PR is merged.

Subtletree commented 2 years ago

@veelenga any chance you can test again with https://github.com/miguelcobain/ember-paper/pull/1211?

veelenga commented 2 years ago

@Subtletree thanks for the heads up.

Unfortunately, i'm still getting the same error but the stacktrace doesn't head to ember-paper anymore.

expand ``` ================================================================================= ENV Summary: TIME: Mon Feb 21 2022 10:09:05 GMT+0200 (Eastern European Standard Time) TITLE: ember ARGV: - ~/.nvm/versions/node/v14.18.1/bin/node - myapp/node_modules/.bin/ember - serve EXEC_PATH: ~/.nvm/versions/node/v14.18.1/bin/node TMPDIR: /var/folders/rt/3thkvgpd4jd0gbr1q_j_f0r00000gn/T SHELL: /bin/zsh PLATFORM: darwin arm64 FREEMEM: 77611008 TOTALMEM: 17179869184 UPTIME: 4140879 LOADAVG: 14.22119140625,11.38916015625,7.423828125 CPUS: - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 - Apple M1 - 24 ENDIANNESS: LE VERSIONS: - ares: 1.17.2 - brotli: 1.0.9 - cldr: 39.0 - icu: 69.1 - llhttp: 2.1.4 - modules: 83 - napi: 8 - nghttp2: 1.42.0 - node: 14.18.1 - openssl: 1.1.1l - tz: 2021a - unicode: 13.0 - uv: 1.42.0 - v8: 8.4.371.23-node.84 - zlib: 1.2.11 ERROR Summary: - broccoliBuilderErrorStack: [undefined] - code: [undefined] - codeFrame: [undefined] - errorMessage: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable. - errorType: [undefined] - location: - column: [undefined] - file: [undefined] - line: [undefined] - message: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable. - name: Error - nodeAnnotation: [undefined] - nodeName: [undefined] - originalErrorMessage: [undefined] - stack: Error: [Embroider:MacrosConfig] the given config from 'myapp/node_modules/ember-basic-dropdown/node_modules/ember-get-config' for packageName 'undefined' is not JSON serializable. at MacrosConfig.internalSetConfig (myapp/node_modules/@embroider/macros/src/macros-config.js:163:19) at MacrosConfig.setOwnConfig (myapp/node_modules/@embroider/macros/src/macros-config.js:142:21) at Class.included (myapp/node_modules/@embroider/macros/src/ember-addon-main.js:25:26) at Class.superWrapper [as included] (myapp/node_modules/core-object/lib/assign-properties.js:34:20) at myapp/node_modules/ember-cli/lib/models/addon.js:497:26 at Array.reduce () at Class.eachAddonInvoke (myapp/node_modules/ember-cli/lib/models/addon.js:494:24) at Class.included (myapp/node_modules/ember-cli/lib/models/addon.js:769:10) at Class.superWrapper [as included] (myapp/node_modules/core-object/lib/assign-properties.js:34:20) at Class.included (myapp/node_modules/ember-basic-dropdown/node_modules/ember-get-config/index.js:29:26) ================================================================================= ```

Also, my embroider-related deps look like this:

$ npm ls @embroider/macros
├─┬ ember-auto-import@2.4.0
│ └── @embroider/macros@1.0.0
├─┬ ember-cli-clipboard@0.16.0
│ └─┬ @ember/render-modifiers@2.0.4
│   └── @embroider/macros@1.2.0
├─┬ ember-exam@8.0.0
│ └── @embroider/macros@1.2.0
├─┬ ember-paper@1.0.0-beta.36
│ └─┬ ember-basic-dropdown@4.0.4
│   ├── @embroider/macros@1.2.0
│   └─┬ ember-get-config@1.0.2
│     └── @embroider/macros@1.2.0  deduped
└─┬ ember-power-select@5.0.4
  └─┬ @embroider/util@1.2.0
    └── @embroider/macros@1.2.0  deduped

It looks like the problem is unrelated to ember-paper anymore, please feel free to close.

veelenga commented 2 years ago

I found a problem in the app itself. Our environment config was not compatible with a new @embroider/macros (not serializable).

Thanks for the help.