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

Import from from rxjs errors out the SSRing of the application #26235

Closed
1 task
yharaskrik opened this issue Nov 5, 2023 · 1 comment · Fixed by #26247
Closed
1 task

Import from from rxjs errors out the SSRing of the application #26235

yharaskrik opened this issue Nov 5, 2023 · 1 comment · Fixed by #26247

Comments

@yharaskrik
Copy link

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Importing and using from from rxjs throws error once page is requested

Minimal Reproduction

https://github.com/yharaskrik/angular-17-ssr-application-builder/tree/jaybell/from-rxjs-issue

yarn ng serve

open localhost:4200

Exception or Error

Unchanged output files: 2
Application bundle generation complete. [0.355 seconds]
Reloading client(s)...
6:04:49 AM [vite] Error when evaluating SSR module /main.server.mjs:
|- TypeError: Cannot read properties of undefined (reading 'from')
    at eval (/Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/.angular/vite-root/e068deec-5f27-448b-9ec4-996512fe0217/src/app/app.component.ts:4:20)
    at async instantiateModule (file:///Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:9)

6:04:49 AM [vite] Internal server error: Cannot read properties of undefined (reading 'from')
      at eval (/Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/.angular/vite-root/e068deec-5f27-448b-9ec4-996512fe0217/src/app/app.component.ts:4:20)
      at async instantiateModule (file:///Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:9)
6:04:49 AM [vite] Internal server error: Cannot read properties of undefined (reading 'from')
      at eval (/Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/.angular/vite-root/e068deec-5f27-448b-9ec4-996512fe0217/src/app/app.component.ts:4:20)
      at async instantiateModule (file:///Users/jaybell/WebstormProjects/angular-17-ssr-application-builder/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:9) (x2)

Your Environment

Angular CLI: 17.0.0-rc.3
Node: 18.18.2
Package Manager: npm 9.8.1
OS: darwin arm64

Angular: 17.0.0-rc.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.0-next.0+sha-fdee8b7
@angular-devkit/build-angular   17.1.0-next.0+sha-fdee8b7
@angular-devkit/core            17.0.0-rc.3
@angular-devkit/schematics      17.0.0-rc.3
@angular/cli                    17.0.0-rc.3
@angular/ssr                    17.0.0-rc.3
@schematics/angular             17.0.0-rc.3
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

No response

@alan-agius4 alan-agius4 self-assigned this Nov 5, 2023
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 6, 2023
…or SSR

It appears that Vite currently, has a number of limitation/bugs when using `optimizeDeps` for SSR bundles.

Currently this causes a number of issues:
  - Deps are re-optimized everytime the server is started.
  - Added deps after a rebuild are not optimized.
  - Breaks RxJs (Unless it is added as external). See: angular#26235

We should follow up with Vite and try to get this solved as this would be a nice feature to use.

Closes angular#26235 and angular#26234
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 6, 2023
…or SSR

It appears that Vite currently, has a number of limitation/bugs when using `optimizeDeps` for SSR bundles.

Currently this causes a number of issues:
  - Deps are re-optimized everytime the server is started.
  - Added deps after a rebuild are not optimized.
  - Breaks RxJs (Unless it is added as external). See: angular#26235

We should follow up with Vite and try to get this solved as this would be a nice feature to use.

Closes angular#26235 and angular#26234
alan-agius4 added a commit that referenced this issue Nov 6, 2023
…or SSR

It appears that Vite currently, has a number of limitation/bugs when using `optimizeDeps` for SSR bundles.

Currently this causes a number of issues:
  - Deps are re-optimized everytime the server is started.
  - Added deps after a rebuild are not optimized.
  - Breaks RxJs (Unless it is added as external). See: #26235

We should follow up with Vite and try to get this solved as this would be a nice feature to use.

Closes #26235 and #26234
alan-agius4 added a commit that referenced this issue Nov 6, 2023
…or SSR

It appears that Vite currently, has a number of limitation/bugs when using `optimizeDeps` for SSR bundles.

Currently this causes a number of issues:
  - Deps are re-optimized everytime the server is started.
  - Added deps after a rebuild are not optimized.
  - Breaks RxJs (Unless it is added as external). See: #26235

We should follow up with Vite and try to get this solved as this would be a nice feature to use.

Closes #26235 and #26234

(cherry picked from commit 7cb5d35)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants