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

Unable to resolve [sub]package X from /tmp/.../direct-dependency #459

Closed
NullVoxPopuli opened this issue May 24, 2020 · 3 comments · May be fixed by NullVoxPopuli/emberclear#784
Closed

Comments

@NullVoxPopuli
Copy link
Collaborator

Didn't look like anyone has reported encountering this kind of issue before, but wanted to report it in case someone else comes across it in the future:

This came from using an experimental branch of ember-statecharts, here: LevelbossMike/ember-statecharts#241
which uses @pzuraq's not-for-production @use/resource polyfill: https://github.com/pzuraq/ember-usable

ember-usable is defined as ember-resource in the package.json https://github.com/LevelbossMike/ember-statecharts/pull/241/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R31

but is imported as import { *stuff* } from 'ember-usable';
I assume the issue is that ember-resource should be renamed to ember-usable in the package.json? Will try that and report back.

error report:

ERROR Summary:

  - broccoliBuilderErrorStack: Error: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
    at MovedPackageCache.resolve (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package-cache.js:30:21)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package.js:164:38
    at Array.map (<anonymous>:null:null)
    at Package.get dependencies (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package.js:157:22)
    at Package.<anonymous> (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/typescript-memoize/dist/memoize-decorator.js:67:52)
    at CompatAddons.linkNonCopiedDeps (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:186:29)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:106:22
    at Array.forEach (<anonymous>:null:null)
    at CompatAddons.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:70:48)
    at WaitForTrees.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/wait-for-trees.js:60:21)
    at TransformNodeWrapper.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/wrappers/transform-node.js:67:39)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/builder.js:118:30
    at runMicrotasks (<anonymous>:null:null)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Builder.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/builder.js:137:13)
    at Builder.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:197:11)

  - code: [undefined]
  - codeFrame: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
  - errorMessage: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
        at WaitForTrees (@embroider/compat/addons)
-~- created here: -~-
    at new Plugin (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/node_modules/broccoli-plugin/dist/index.js:45:31)
    at new WaitForTrees (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/wait-for-trees.js:30:9)
    at CompatAddons.get tree [as tree] (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:47:16)
    at CompatApp.augment (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/build-stage.js:57:64)
    at CompatApp.get tree (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/build-stage.js:26:50)
    at CompatApp.<anonymous> (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/typescript-memoize/dist/memoize-decorator.js:67:52)
    at new PackagerRunner (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/to-broccoli-plugin.js:10:26)
    at defaultPipeline (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/default-pipeline.js:35:12)
    at module.exports (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/ember-cli-build.js:125:12)
    at Builder.readBuildFile (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:49:14)
    at Builder.setupBroccoliBuilder (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:63:22)
    at new Builder (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:29:10)
    at ServeTask.run (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/tasks/serve.js:49:7)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/command.js:238:24
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

-~- (end) -~-
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
    - treeDir: [undefined]
  - message: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
        at WaitForTrees (@embroider/compat/addons)
-~- created here: -~-
    at new Plugin (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/node_modules/broccoli-plugin/dist/index.js:45:31)
    at new WaitForTrees (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/wait-for-trees.js:30:9)
    at CompatAddons.get tree [as tree] (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:47:16)
    at CompatApp.augment (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/build-stage.js:57:64)
    at CompatApp.get tree (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/build-stage.js:26:50)
    at CompatApp.<anonymous> (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/typescript-memoize/dist/memoize-decorator.js:67:52)
    at new PackagerRunner (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/to-broccoli-plugin.js:10:26)
    at defaultPipeline (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/default-pipeline.js:35:12)
    at module.exports (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/ember-cli-build.js:125:12)
    at Builder.readBuildFile (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:49:14)
    at Builder.setupBroccoliBuilder (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:63:22)
    at new Builder (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:29:10)
    at ServeTask.run (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/tasks/serve.js:49:7)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/command.js:238:24
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

-~- (end) -~-
  - name: Error
  - nodeAnnotation: @embroider/compat/addons
  - nodeName: WaitForTrees
  - originalErrorMessage: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
  - stack: Error: unable to resolve package ember-resource from /tmp/embroider/dc7fab/node_modules/ember-statecharts
    at MovedPackageCache.resolve (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package-cache.js:30:21)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package.js:164:38
    at Array.map (<anonymous>:null:null)
    at Package.get dependencies (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/package.js:157:22)
    at Package.<anonymous> (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/typescript-memoize/dist/memoize-decorator.js:67:52)
    at CompatAddons.linkNonCopiedDeps (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:186:29)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:106:22
    at Array.forEach (<anonymous>:null:null)
    at CompatAddons.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/compat/src/compat-addons.js:70:48)
    at WaitForTrees.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/@embroider/core/src/wait-for-trees.js:60:21)
    at TransformNodeWrapper.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/wrappers/transform-node.js:67:39)
    at /home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/builder.js:118:30
    at runMicrotasks (<anonymous>:null:null)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Builder.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/node_modules/broccoli/dist/builder.js:137:13)
    at Builder.build (/home/preston/Development/NullVoxpopuli/emberclear/packages/frontend/node_modules/ember-cli/lib/models/builder.js:197:11)

@NullVoxPopuli
Copy link
Collaborator Author

well, after re-naming the entry in package.json, I get this error:

unable to resolve package ember-usable from /tmp/embroider/dc7fab/node_modules/ember-statecharts

stacks look the same :-\

@NullVoxPopuli
Copy link
Collaborator Author

oh nevermind, I was using the wrong commit from ember-usable :D

everything is fine, now that the package.json (both the dep of ember-statecharts and the name of ember-usable) matches the import name

@ef4
Copy link
Contributor

ef4 commented May 25, 2020

Embroider does have ways of supporting packages that diverge from their real names, but it's always better to avoid that. Not least because it's confusing for human readers too!

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.

2 participants