Paciolan / remote-module-loader

Loads a CommonJS module from a remote URL for the Browser or Node.js.
MIT License
85 stars 21 forks source link

Server Side loading doesn't check status code for 200 #21

Closed joelnet closed 3 years ago

joelnet commented 3 years ago

Might get an error similar to (below) when attempting to parse the JavaScript of an invalid response.

SyntaxError: Unexpected token < at new Function (<anonymous>) at /System/Volumes/Data/et/repo/@paciolan/evenue-next-server/src/node_modules/@paciolan/remote-module-loader/dist/lib/loadRemoteModule.js:21:24 at process._tickCallback (internal/process/next_tick.js:68:7) SyntaxError: Unexpected token < at new Function (<anonymous>) at /System/Volumes/Data/et/repo/@paciolan/evenue-next-server/src/node_modules/@paciolan/remote-module-loader/dist/lib/loadRemoteModule.js:21:24 at process._tickCallback (internal/process/next_tick.js:68:7)

Would be nice if the error message was more descriptive.