question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "SCRIPT 1028 Expected identifier, string or number" with IE11

See original GitHub issue

Hello,

first thanks for this library which was especially helpful for merging objects. 😃

The issue I have is with IE11 which does not seem to like the name of some functions like get in get(obj, path, value) and generate the classic error:

SCRIPT 1028 Expected identifier, string or number

Yet I’m using a whole bunch of transpilation tools to be sure the generated code is compatible with older browsers:

browserify --extension=.jsx --transform [babelify --presets=es2015,stage-2,react --plugins=[babel-plugin-transform-es3-member-expression-literals,babel-plugin-transform-es3-property-literals]] --transform [es3ify] GUI/index.jsx --outfile dist/GUI/bundle.js

But as far as I understand the tools consider your code as valid, which it is for most browsers indeed.

Have you ever heard about this issue?

Thanks.

Mickael

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Pragmateekcommented, Jun 21, 2017

Hello, FYI I have finally fixed it by hand by pre-generating a transpiled version of dot-prop. package.json:

"scripts": {
    "precompile": "babel node_modules/dot-prop/index.js --out-file precompiled/dot-prop.js",

And referencing it in place of the original package stored in node_modules. someModule.js:

const dotProp = require("../precompiled/dot-prop");

Hopefully it will help someone else. 😃

0reactions
Pragmateekcommented, Jun 21, 2017

I agree this is not a perfect solution, and I would not scale it to dozens of modules. But for my use-case this is a pragmatic workaround that has unblocked IE 11 support. As for Webpack I’ve tried it and unfortunately it comes with its own set of issues and bugs so I will wait for it to be ready for prime-time. I’ll post any better solution, stay tuned… 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

SCRIPT1028: Expected identifier, string or number
There are 2 common causes for this error. Either having a trailing comma when inappropriate, or using a JavaScript reserved word.
Read more >
SOLUTION: SCRIPT1028: Expected identifier, string or number
There are 2 common ways to trigger the SCRIPT1028: Expected identifier, string or number JavaScript error in earlier versions of Internet ...
Read more >
Error "SCRIPT 1028 Expected identifier, string or number" ...
[Solved]-Error "SCRIPT 1028 Expected identifier, string or number" with IE11-babel. js. The issue was more subtle: as dot-prop is a dependency stored in...
Read more >
SCRIPT1028: Expected identifier, string
**Actual behavior** Vue fails to load cause script error [Error: SCRIPT1028: SCRIPT1028: Expected identifier, string or number].
Read more >
Error with Internet Explorer 11 - SCRIPT1028 - Questions
... error at line 144, column 336 in http://localhost:53394/Scripts/handsontable/handsontable.full.js\n\nSCRIPT1028: Expected identifier, string or number.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found