aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

angular 18 build isuue with eventResource

Open Mehdi-MST opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

when we build angular 18 it is complaining about the eventSource module which being used by signalR: node_modules/eventsource/lib/eventsource.js:1:20: 1 │ var parse = require('url').parse; The package "url" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error. node_modules/eventsource/lib/eventsource.js:3:20: 3 │ var https = require('https')

Expected Behavior

it should build without complaining about it. my tsconfig having this

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8

Anything else?

my tsconfig having this "moduleResolution": "node", "importHelpers": true, "lib": ["ES2023", "DOM"], "target": "ES2022", "module": "ES2022",

Mehdi-MST avatar Jun 27 '24 23:06 Mehdi-MST

fixed by changing "moduleResolution": "node", to "moduleResolution": "bundler",

Mehdi-MST avatar Jun 28 '24 08:06 Mehdi-MST

Facing same issue in angular 19, moduleResolution: "bundler", does not resolve errors in my case

Muntazir86 avatar May 06 '25 10:05 Muntazir86