Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

Thrown “SCRIPT1028: SCRIPT1028: Expected identifier, string or number” in Edge browser. #5005

Closed Shawngbk closed 4 years ago

Shawngbk commented 5 years ago

Hi @southpolesteve

Thanks for your help! Could you please look into the below issue?

When using an Angular app which use the @azure/cosmos and run it at Edge browser, it will hit the below error message. “SCRIPT1028: SCRIPT1028: Expected identifier, string or number” Clicking the error, I found the error throwed by the line 39. After search it, found this github link: https://github.com/sindresorhus/crypto-hash/blob/master/browser.js#L39 This code is part of the ‘crypto-hash.’

It seems that the ‘crypto-hash’ is required if use the @azure/cosmos.

I search again and found below link which indicating that Edge doesn’t support the Rest parameters (the syntax is ‘…options’) https://stackoverflow.com/questions/53628191/edge-script1028-expected-identifier-string-or-number

Then, the issue seems to be the dead-lock status. The Angular app use the @azure/cosmos. @azure/cosmos required the ‘crypto-hash’. ‘crypto-hash’ use the Rest parameters. However, the Edge doesn’t support such syntax.. Therefore, the above restriction let the Angular app cannot be used in the Edge browser.

This is a sample which you can simply repro the issue: https://github.com/jeffrey008/empty-angular

I fully know this might be a pure front-end issue or Edge issue. I still hope to consult from your side and see if there is any idea for resolving the issue.

Shawngbk commented 5 years ago

hi @southpolesteve May I know is there the current ETA for replacing the cypto-hash?

southpolesteve commented 5 years ago

No ETA at this time. We are evaluating making our own crypto shim in #5023

Shawngbk commented 5 years ago

Appreciate your help! Looking forward to the further steps.

southpolesteve commented 4 years ago

This was resolved in 3.3.4