web icon indicating copy to clipboard operation
web copied to clipboard

[Server] Mutating source files resulting in them being invalid

Open Garbee opened this issue 1 year ago • 0 comments

Problem

It seems the server is doing something that mutates the code as it is resolved. This mutation is causing some source files to end up invalid, thus breaking builds.

Sample Case

https://github.com/Garbee/dev-server-sample/tree/main

https://www.npmjs.com/package/@langchain/core is being broken when ran through the server. At least for their "RemoteRunnable" class. The last quote in the imported file is removed, resulting in a JS file that has invalid syntax.

Expected Result

Files to not end up invalid, thus not breaking builds.

Workaround

For now, I've worked around this issue by introducing Rollup to just compile everything first. Even when developing locally.

Garbee avatar Feb 24 '24 23:02 Garbee