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

Reproduction of build issue with tracked-toolbox: Could not resolve "@ember/debug", etc #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lolmaus
Copy link
Collaborator

@lolmaus lolmaus commented Sep 18, 2023

image

✘ [ERROR] Could not resolve "@ember/debug"

    node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:1:23:
      1 │ import { assert } from '@ember/debug';
        ╵                        ~~~~~~~~~~~~~~

  You can mark the path "@ember/debug" as external to exclude it from the bundle, which will remove
  this error.

✘ [ERROR] Could not resolve "@ember/object"

    node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:2:20:
      2 │ import { get } from '@ember/object';
        ╵                     ~~~~~~~~~~~~~~~

  You can mark the path "@ember/object" as external to exclude it from the bundle, which will remove
  this error.

✘ [ERROR] Could not resolve "@glimmer/tracking/primitives/cache"

    node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:4:38:
      4 │ import { createCache, getValue } from '@glimmer/tracking/primitives/cache';
        ╵                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@glimmer/tracking/primitives/cache" as external to exclude it from the
  bundle, which will remove this error.

3:41:23 PM [vite] error while updating dependencies:
Error: Build failed with 3 errors:
node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:1:23: ERROR: Could not resolve "@ember/debug"
node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:2:20: ERROR: Could not resolve "@ember/object"
node_modules/.pnpm/tracked-toolbox@2.0.0_@babel+core@7.22.15_ember-source@5.1.2/node_modules/tracked-toolbox/dist/index.js:4:38: ERROR: Could not resolve "@glimmer/tracking/primitives/cache"
    at failureErrorWithLog (/home/lolmaus/Code/mainmatter/mainmatter/ember-vite-app/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1649:15)
    at /home/lolmaus/Code/mainmatter/mainmatter/ember-vite-app/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1058:25
    at /home/lolmaus/Code/mainmatter/mainmatter/ember-vite-app/node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1525:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ELIFECYCLE  Command failed with exit code 1.

@lolmaus
Copy link
Collaborator Author

lolmaus commented Sep 27, 2023

Me and @mansona have attempted to use @ef4's branch esbuild-resolver of Embroider.

This PR currently uses local dependencies and overrides, so if you want to run it locally, you need to:

  1. clone embroider into an adjacent folder called embroider;
  2. check out the esbuild-resolver branch.

Using the esbuild-resolver has fixed the issue from the description of this PR, but it produced a new one:

validator.js:631 Uncaught Error: The @glimmer/validator library has been included twice in this application. It could be different versions of the package, or the same version included twice by mistake. @glimmer/validator depends on having a single copy of the package in use at any time in an application, even if they are the same version. You must dedupe your build to remove the duplicate packages in order to prevent this error.
at validator.js:631:9

This error appears in the browser (i. e. the build's termial output does not contain the errors).

On the Network tab, validator.js is loaded once, the referrer is /node_modules/.embroider/rewritten-packages/ember-source.87c04e1d/@ember/-internals/metal/index.js?v=3a83e994.

image

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 this pull request may close these issues.

None yet

1 participant