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

Add missing URL import #64

Closed
wants to merge 1 commit into from
Closed

Add missing URL import #64

wants to merge 1 commit into from

Conversation

Dishwasha
Copy link

This should fix the following error seen:

(node:17) UnhandledPromiseRejectionWarning: ReferenceError: URL is not defined
at Object.buildEndpointUrl (/app/node_modules/@bugsnag/source-maps/dist/uploaders/lib/EndpointUrl.js:6:17)
at Object. (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:90:33)
at Generator.next ()
at /app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:8:71
at new Promise ()
at __awaiter (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:4:12)
at Object.uploadMultiple (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:86:12)
at Object. (/app/script/bugsnag-upload.js:18:9)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)

Goal

Design

Changeset

Testing

This should fix the following error seen:

(node:17) UnhandledPromiseRejectionWarning: ReferenceError: URL is not defined
    at Object.buildEndpointUrl (/app/node_modules/@bugsnag/source-maps/dist/uploaders/lib/EndpointUrl.js:6:17)
    at Object.<anonymous> (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:90:33)
    at Generator.next (<anonymous>)
    at /app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:4:12)
    at Object.uploadMultiple (/app/node_modules/@bugsnag/source-maps/dist/uploaders/BrowserUploader.js:86:12)
    at Object.<anonymous> (/app/script/bugsnag-upload.js:18:9)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
@yousif-bugsnag
Copy link
Contributor

Hi @Dishwasha,

URL is a global in Node 10 or above so this shouldn't be necessary. Are you using an old version of Node?

@yousif-bugsnag yousif-bugsnag added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label May 17, 2021
@Dishwasha
Copy link
Author

Hi @Dishwasha,

URL is a global in Node 10 or above so this shouldn't be necessary. Are you using an old version of Node?

Yes, we are unfortunately using node 8 in one of our legacy applications we integrate bugsnag with.

@xljones
Copy link
Contributor

xljones commented May 18, 2021

Hey @Dishwasha, the minimum required system version for this tool is Node.js v10.

If you're using Node.js v8 for your application, it's still possible to install multiple Node versions side-by-side on your machine with tools like nvm or nave; you can then switch to use a version of Node >=10 for the use of the @bugsnag/source-maps tool, and then switch back to Node.js 8 for your application.

Would this work for your use case?

@Dishwasha
Copy link
Author

Merging this would work better :) I understand you don't support node 8, but it incidentally working couldn't hurt...

@xljones
Copy link
Contributor

xljones commented May 18, 2021

Hey @Dishwasha, would totally agree if this did fix the issue. However, whilst this does fix the URL is not defined error, there's some further issues when running on Node 8 that rear their head after this change is made where bundle files being targeted can't be found on the filesystem:

ERROR  The source map "./maps/bundle.js.map" could not be found. Tried at the following location.   

Even though this is a legitimate map; switching to Node.js v14 and re-running this command does not throw this error. There may also be some further errors hiding behind this.

There's not currently any appetite to support older versions of Node I'm afraid. However, be happy to re-assess this PR if these issues are fixed.

@Dishwasha Dishwasha closed this May 18, 2021
@mattdyoung mattdyoung removed the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants