You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use @vitejs/plugin-legacy to compile code for chrome 49.
Below is my setting in viteconfig.js:
const legacyOption = {
targets: ['Chrome >= 49', 'Firefox >= 52'],
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to use @vitejs/plugin-legacy to compile code for chrome 49.
Below is my setting in viteconfig.js:
const legacyOption = {
targets: ['Chrome >= 49', 'Firefox >= 52'],
}
export default ({ command, mode }) => {
return {
root,
resolve,
server,
css,
//build,
plugins: [
vue(),
legacy(legacyOption)
],
}
}
Compile finished without error. However, when I open the website and login, on page routing I got several errors:
Uncaught SyntaxError: Unexpected token import
polyfills-legacy.6efd4eb6.js:1 Unhandled promise rejection SyntaxError: Unexpected token import(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Uo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1lo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Ui.(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Mi @ polyfills-legacy.6efd4eb6.js:1Fi @ polyfills-legacy.6efd4eb6.js:1
polyfills-legacy.6efd4eb6.js:1 Unhandled promise rejection TypeError: Illegal invocation(…)(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Uo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1lo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Ui.(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Mi @ polyfills-legacy.6efd4eb6.js:1Fi @ polyfills-legacy.6efd4eb6.js:1
resize-event-legacy.697e0ca5.js:1 Uncaught SyntaxError: Unexpected token import
polyfills-legacy.6efd4eb6.js:1 Unhandled promise rejection SyntaxError: Unexpected token import(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Uo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1lo @ polyfills-legacy.6efd4eb6.js:1(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Ui.(anonymous function) @ polyfills-legacy.6efd4eb6.js:1Mi @ polyfills-legacy.6efd4eb6.js:1Fi @ polyfills-legacy.6efd4eb6.js:1
polyfills-legacy.6efd4eb6.js:1 Unhandled promise rejection SyntaxError: Unexpected token import
Can anybody help to figure out how to solve this?
Appreciate for any hint...
Beta Was this translation helpful? Give feedback.
All reactions