Tools: es5-bundled | SyntaxError: Cannot use 'import.meta' outside a module

Created on 22 Jul 2018  路  9Comments  路  Source: Polymer/tools

"polymer-cli": "^1.7.7",
getting the below error on Opera 54 with es5-bundled.
esm-bundled works fine.

image

wontfix

Most helpful comment

Doesn't work for me, even with minify false. I still get this error

All 9 comments

I'm having the same issue, any update on this?

@swapkats it looks like bable minify issue https://github.com/babel/minify/issues/850, which fails in es5 bundle causes this.
Until the fix is available, disabling minify fixes the issue

{
"name": "es5-bundled",
"js": {
"compile": "es5",
"minify": false,
"transformModulesToAmd": true
},
"css": {
"minify": true
},
"html": {
"minify": true
},
"bundle": true,
"addServiceWorker": true
}

@ranjeet-choudhary thanks for pointing out. I'm using esm-bundled as you said till it's fixed, seems to work fine.

hey any updates on this issue
it is working with minify option false
but that is not good for performance

Doesn't work for me, even with minify false. I still get this error

Same here, what is a workaround? import.meta shouldn't even be in a ES5 compliant bundle

you are all missing a package. just reinstall.

I was not missing anything. I followed @ranjeet-choudhary instructions above and got it working.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings