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

Proxy with Angular 17 #1409

Open
1 task done
tagazok opened this issue Apr 12, 2024 · 1 comment
Open
1 task done

Proxy with Angular 17 #1409

tagazok opened this issue Apr 12, 2024 · 1 comment

Comments

@tagazok
Copy link

tagazok commented Apr 12, 2024

Describe the bug

Hi,

I have a project that works perfectly with Angular 16 and webcontainers.io
However, I just uplated the project to Angular 17 and it doesn't work anymore.

This is the error I have:

[vite] http proxy error: Must provide a proper URL as target
Error: Must provide a proper URL as target
    at ProxyServer.<anonymous> (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:62959:36)
    at viteProxyMiddleware (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:63273:23)
    at call (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:42750:7)
    at next (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:42694:5)
    at viteCachedTransformMiddleware (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:63421:9)
    at call (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:42750:7)
    at next (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:42694:5)
    at cors (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:43222:7)
    at file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:43258:17
    at originCallback (file:///Users/oleplus/lab/prompt-challenge-light/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:43248:15)

This may be due to Angular moving from webpack to vite but I didn't figure out how to fix the issue. I don't have the issue if I remove the proxy configuration but then webcontainers doesn't work anymore because of "SharedArrayBuffers" issue

Here is my proxy confitguration in my angular.json (it hasn't changed when updating the project from Angular 16 to Angular 17)

"options": {
    "headers": {
      "Cross-Origin-Embedder-Policy": "require-corp",
      "Cross-Origin-Opener-Policy": "same-origin"
    }
  }

Link to the blitz that caused the error

NA

Steps to reproduce

Update a project from Angular 16 to Angular 17

Expected behavior

I expected it to work ^^

Parity with Local

Screenshots

No response

Platform

  • OS: macOS
  • Browser: Version
  • Version: 123.0.6312.122 (Official Build) (arm64)

Additional context

No response

@SamVerschueren
Copy link
Contributor

Hey @tagazok 👋 . Thanks for reaching out! Do you happen to have the project (or something reproducable) somewhere on GitHub? That would definitely help to identify the issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@SamVerschueren @tagazok and others