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

ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import #203

Closed
alexmiddeleer opened this issue Jun 21, 2018 · 5 comments

Comments

@alexmiddeleer
Copy link

alexmiddeleer commented Jun 21, 2018

Thanks for all of your great addons! I'm seeing the following error during our build - it doesn't happen in dev or testing (I assume because babel not required?). This is the error:
Note: we are on ember 2.18, ember-cli-babel 6.6

  - broccoliBuilderErrorStack: SyntaxError: ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import
> 1 | import { expandProperties } from '@ember/object/computed';
    | ^
  2 | 
  3 | export default function(property) {
  4 |   let newPropertyList = [];
    at File.buildCodeFrameError (/Users/alex/proj/desktop-fe/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/transformation/file/index.js:427:15)
    at NodePath.buildCodeFrameError (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/index.js:140:26)
    at ImportDeclaration.specifiers.forEach.specifierPath (/Users/alex/proj/desktop-fe/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:123:26)
    at Array.forEach (native)
    at PluginPass.ImportDeclaration (/Users/alex/proj/desktop-fe/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:88:22)
    at newFn (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/context.js:150:16)
  - codeFrame: > 1 | import { expandProperties } from '@ember/object/computed';
    | ^
  2 | 
  3 | export default function(property) {
  4 |   let newPropertyList = [];
  - errorMessage: Build Canceled: Broccoli Builder ran into an error with `Babel` plugin. 💥
ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import
  - errorType: Build Error
  - location:
    - column: 0
    - line: 1
  - message: Build Canceled: Broccoli Builder ran into an error with `Babel` plugin. 💥
ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import
  - name: Error
  - nodeAnnotation: Babel
  - nodeName: Babel
  - originalErrorMessage: ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import
  - stack: SyntaxError: ember-macro-helpers/expand-property.js: @ember/object/computed does not have a expandProperties import
> 1 | import { expandProperties } from '@ember/object/computed';
    | ^
  2 | 
  3 | export default function(property) {
  4 |   let newPropertyList = [];
    at File.buildCodeFrameError (/Users/alex/proj/desktop-fe/node_modules/broccoli-babel-transpiler/node_modules/babel-core/lib/transformation/file/index.js:427:15)
    at NodePath.buildCodeFrameError (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/index.js:140:26)
    at ImportDeclaration.specifiers.forEach.specifierPath (/Users/alex/proj/desktop-fe/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:123:26)
    at Array.forEach (native)
    at PluginPass.ImportDeclaration (/Users/alex/proj/desktop-fe/node_modules/babel-plugin-ember-modules-api-polyfill/src/index.js:88:22)
    at newFn (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/Users/alex/proj/desktop-fe/node_modules/babel-traverse/lib/context.js:150:16)
@kellyselden
Copy link
Owner

Looks like that expandProperties was either removed from @ember/object/computed in a new version, or was private the whole time and removed. Can you look into this?

@alexmiddeleer
Copy link
Author

Yeah, I'm still investigating.

@alexmiddeleer
Copy link
Author

alexmiddeleer commented Jun 22, 2018

Update - I can only reproduce this with yarn.

rm -rf node_modules
npm cache clean
npm install
ember s

App builds and runs.

rm -rf node_modules
yarn cache clean
yarn
ember s

results in the error. I will try to reproduce in a new app instead of ours. I am guessing this is not a problem with ember-macro-helpers. My npm version is 3.10.9 and yarn is 1.7.0 if that matters (occurred in yarn 1.6.0 as well)

@alexmiddeleer
Copy link
Author

Closing as I was unable to determine the root cause. Seems to have been a yarn bug. I was able to fix by essentially starting from a working point and recreating all of the changes slowly, checking for the build failures as I went. The failure never recurred.

@kellyselden
Copy link
Owner

Thanks for investigating.

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

No branches or pull requests

2 participants