analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.57k stars 245 forks source link

Bug: zone.js import not found in versions greater than 0.13.1 #650

Closed rlmestre closed 1 year ago

rlmestre commented 1 year ago

Please provide the environment you discovered this bug in.

M1 Mac, Node 20.5.1, zone.js 0.13.2 and 0.13.3

Which area/package is the issue in?

astro-angular

Description

Recent changes to zone.js exports and bundling are breaking the Astro integration. This happened when adding the plugin with pnpm astro add @analogjs/astro-angular because the zone.js version isn't pinned.

Please provide the exception or error you saw

✘ [ERROR] Could not resolve "zone.js/dist/zone.js"
    node_modules/@analogjs/astro-angular/src/client.js:1:7:
      1 │ import 'zone.js/dist/zone.js';
        ╵        ~~~~~~~~~~~~~~~~~~~~~~
  The module "./bundles/zone.js.umd.js" was not found on the file system:
    node_modules/zone.js/package.json:91:17:
      91 │       "default": "./bundles/*.umd.js"
         ╵                  ~~~~~~~~~~~~~~~~~~~~

Other information

Removing .js from the import fixes the issue and does not break backwards compatibility. Otherwise we could pin the version.

I would be willing to submit a PR to fix this issue

rlmestre commented 1 year ago

Actually those deep imports will be removed, so maybe we change it to import 'zone.js'; now?