alexlafroscia / ember-esbuild

Ember tooling for ESBuild
12 stars 1 forks source link

Error report #4

Closed MichalBryxi closed 3 years ago

MichalBryxi commented 3 years ago

Just tried to drop ember-esbuild in one of my fun projects to see whether it might boot up. It did not. Thought the error might be useful:

> DEBUG=ember-cli:* yarn start
...
  ember-cli:addon:tree-cache [treeFor(ember-pikaday - addon-test-support)#2707 -> treeFor(moment - addon-test-support)#2710 -> treeFor(ember-get-config - addon-test-support)#2714] Cache Add: 20281db741f4a6e30f8beef08b306638 - true +0ms
  ember-cli:merge-trees [treeFor(ember-pikaday - addon-test-support)#2707 -> treeFor(moment - addon-test-support)#2710 -> EmberCliMergeTrees(Addon#treeFor (moment - addon-test-support))#2717] Returning empty tree +0ms
  ember-cli:addon:tree-cache [treeFor(bp-ember-components - addon-test-support)#2652 -> treeFor(ember-pikaday - addon-test-support)#2707 -> treeFor(moment - addon-test-support)#2710] Cache Add: 7aa499203e464570332c9b1d6d5dc8dc - true +0ms
  ember-cli:registry loading js: available plugins [ 'ember-cli-babel' ]; found plugins [ 'ember-cli-babel' ]; +22ms
  ember-cli:registry loading js: available plugins [ 'ember-cli-babel' ]; found plugins [ 'ember-cli-babel' ]; +0ms
  ember-cli:preprocessors processing ember-cli-babel +22ms
  ember-cli:command [treeFor(bp-ember-components - addon-test-support)#2652 -> treeFor(ember-pikaday - addon-test-support)#2707] An error occurred running `Serve` from the `serve` command. TypeError: Cannot read property 'pkg' of undefined
    at Class._shouldIncludeHelpers (/Users/michal/projects/kasa/ui/node_modules/ember-cli-babel/index.js:117:94)
    at Class._getBabelOptions (/Users/michal/projects/kasa/ui/node_modules/ember-cli-babel/index.js:272:37)
    at Class.buildBabelOptions (/Users/michal/projects/kasa/ui/node_modules/ember-cli-babel/index.js:33:17)
    at Class.transpileTree (/Users/michal/projects/kasa/ui/node_modules/ember-cli-babel/index.js:49:24)
    at Object.toTree (/Users/michal/projects/kasa/ui/node_modules/ember-cli-babel/index.js:73:30)
    at /Users/michal/projects/kasa/ui/node_modules/ember-cli-preprocess-registry/preprocessors.js:188:26
    at Array.forEach (<anonymous>)
    at processPlugins (/Users/michal/projects/kasa/ui/node_modules/ember-cli-preprocess-registry/preprocessors.js:186:11)
    at Function.module.exports.preprocessJs (/Users/michal/projects/kasa/ui/node_modules/ember-cli-preprocess-registry/preprocessors.js:179:10)
    at Class.preprocessJs (/Users/michal/projects/kasa/ui/node_modules/ember-cli/lib/models/addon.js:1385:25) +2ms
Cannot read property 'pkg' of undefined

Stack Trace and Error Report: /var/folders/8q/yrjx_8s115q43r8w5qd90_m00000gn/T/error.dump.29985be705f3096c9eaba8212e5d9959.log
  ember-cli:bin [treeFor(bp-ember-components - addon-test-support)#2652 -> treeFor(ember-pikaday - addon-test-support)#2707] Quitting "ember-cli" with exit code: 1 +12ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this com

The project is a monorepo with yarn workspaces. Mentioned bp-ember-components is an ember addon that lives and is used from inside the monorepo. In all the ember codebases I ran:

yarn remove ember-cli-babel
ember install ember-cli-esbuild

Both the app and the addon uses `ember-auto-import.

Used version:

"ember-cli-esbuild": "^1.0.0-alpha.0",

Feel free to close this issue if it does not provide any value.

alexlafroscia commented 3 years ago

Thanks for the report! This error

Cannot read property 'pkg' of undefined

Is what you end up seeing without this ember-cli-babel patch applied

https://github.com/babel/ember-cli-babel/pull/368

That PR is still waiting to be merged, so for now, there's not much we can do! I do appreciate your time in reporting the problem, though!