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

Error in ie 11 SCRIPT1003: Expected ':' #439

Open
czbas23 opened this issue Apr 3, 2019 · 26 comments · May be fixed by #480
Open

Error in ie 11 SCRIPT1003: Expected ':' #439

czbas23 opened this issue Apr 3, 2019 · 26 comments · May be fixed by #480

Comments

@czbas23
Copy link

czbas23 commented Apr 3, 2019

No description provided.

@RomanNalapko
Copy link

Hi @rowanwins,
I have the same issue in IE11 with [email protected]

image

image

@rowanwins
Copy link
Owner

Hi @czbas23 & @RomanNalapko

You should be able to find some suggestions to support IE11 in this issue
#437

Regards,
Rowan

@czbas23
Copy link
Author

czbas23 commented Apr 3, 2019

I use Laravel not has file vue.config.js. I use .babelrc, how can I fix the problem?

@RomanNalapko
Copy link

@rowanwins Thanks for advice, but I'm not using vue-cli.
I'm using webpack, ts-loader with target ES5

@rowanwins
Copy link
Owner

Can you try npm install @babel/polyfill --save and then somewhere in your project do import '@babel/polyfill'

@RomanNalapko
Copy link

babel/polyfill does not help

@rosdi
Copy link

rosdi commented Apr 11, 2019

I have to downgrade to 3.5.1 for it to work.
I understands why @rowanwins not supporting this due IE being obsolete browser, but poor souls like us still need to support IE due to company policy.

-- EDIT --
This is not a critisim to @rowanwins ... just explaining why some people insists on IE support... I am deeply thankful for this hard work.

@rowanwins
Copy link
Owner

All good @rosdi :)

I understand that it would be good for it to work, we just need to find a repeatable way for people to do it..

@jsodeman
Copy link

I believe I have a fix for this. Here's my config using Webpack 4 and Babel 7. You'll have to adjust for earlier versions of either.

babel.config.js

module.exports = {
	presets: ["@babel/preset-env"],
	overrides: [
		{
			test: ["./node_modules/vue2-dropzone"],
			presets: [
				["@babel/preset-env", {	targets: { ie: "11" } }],
			],
		}],
};

Inside module:rules: in webpack.config.js

{
	test: /\.js$/,
	exclude: file => (
		/node_modules/.test(file) &&
		!/vue2-dropzone/.test(file)
	),
	use: [
		{ loader: "babel-loader" },
	],
},

@rowanwins
Copy link
Owner

Thanks for sharing @jsodeman

@thatdoorsajar
Copy link

First off thanks @rowanwins this is a great wrapper for dropzone, so much nicer to use in our Vue app.

Like @rosdi I've also had to drop back to 3.5.1 to ensure everything works on IE. This isn't really a problem for us but I am just wandering if IE compatibility is on the road map for future releases?

@lenvanessen
Copy link

Same problem here, would be nice to get a fix for this in the new version.

@rowanwins
Copy link
Owner

Hi @thatdoorsajar & @lenvanessen

A fix would indeed be great. Unfortunately I'm now operating on a mac and so IE11 testing is a bit trickier. I'm open to a PR if someone can identify a resolution.

@alexey-v-paramonov
Copy link

alexey-v-paramonov commented May 31, 2019

This is because dist/vue2Dropzone.js has es6 code not transpiled into es5 supported by IE11.

@WilliamDASILVA
Copy link

Having the same issue as @RomanNalapko with the version 3.5.9.
Tested through BrowserStack.
Capture d’écran 2019-06-05 à 16 40 10

@exhtml
Copy link

exhtml commented Jun 7, 2019

+1 to fix this, thank you very much for your awesome dropzone wrapper!

@arkhamvm
Copy link

+1. Build into es5 should fix the problem.

@dementiev
Copy link

have the same issue in IE 11 with react-babel app

@oh-yeah oh-yeah linked a pull request Jul 25, 2019 that will close this issue
@Paul-Cl-ark
Copy link

Rolling back to 3.5.1 worked for me

@FerraBraiZ
Copy link

FerraBraiZ commented Sep 18, 2019

I believe I have a fix for this. Here's my config using Webpack 4 and Babel 7. You'll have to adjust for earlier versions of either.

babel.config.js

module.exports = {
	presets: ["@babel/preset-env"],
	overrides: [
		{
			test: ["./node_modules/vue2-dropzone"],
			presets: [
				["@babel/preset-env", {	targets: { ie: "11" } }],
			],
		}],
};

Inside module:rules: in webpack.config.js

{
	test: /\.js$/,
	exclude: file => (
		/node_modules/.test(file) &&
		!/vue2-dropzone/.test(file)
	),
	use: [
		{ loader: "babel-loader" },
	],
},

@jsodeman's solution indeed fixed the untranspilled code and it is working in ie 11

@sudhakarselva
Copy link

Nuxt also same issue , tried to build: {
transpile: ['vue2-dropzone']
} but this leads to
Unknown custom element: - did you register the component correctly? For recursive
components, make sure to provide the "name" option.Please provide any workaround? Thanks

@Paul-Cl-ark
Copy link

Paul-Cl-ark commented Mar 9, 2020

Nuxt also same issue , tried to build: {
transpile: ['vue2-dropzone']
} but this leads to
Unknown custom element: - did you register the component correctly? For recursive
components, make sure to provide the "name" option.Please provide any workaround? Thanks

I've had to do this: in vue.config.js:

transpileDependencies: ['vue2-dropzone']

As you can see above, initially rolling back worked, until it didn't...

@sudhakarselva
Copy link

@Paul-Cl-ark , after adding in transpile dep .component stopped working for me. Failed to mount component: template or render function not defined.

@Paul-Cl-ark
Copy link

How are you registering it?

<template>
<VueDropzone />
</template>
<script>
import VueDropzone from 'vue2-dropzone'
export default {
  name: 'UploadBox',
  components: { VueDropzone }
}
</script>

@sudhakarselva
Copy link

sudhakarselva commented Mar 12, 2020

@Paul-Cl-ark .same way only . i tried adding in transpile for babel but i think problem is because we are using code from dist whiich is already built using some babel config .inorder to fix this issue i raised pull request for exposing src folder which is transpiled by my build config so it resolved this issue.I hope it get merged. i think exposing src folder is mandatory so that user can use their build pipeline

Please refer:- #534

Useful link:-
Thorsten Lünborg - Vue CLI – How to write components with it( https://www.youtube.com/watch?v=WH_zrZpMtCE )
Use patch package, if u cant wait for pull request merge. https://www.npmjs.com/package/patch-package

@cys2best
Copy link

cys2best commented Mar 9, 2022

it's worked for me. Thank you

cleverapollo added a commit to cleverapollo/typo-form-web-app that referenced this issue May 28, 2024
…releases of vue-dropzone no longer support IE11

More info here: rowanwins/vue-dropzone#439
Note the removal of `^` as we want it locked from now on.
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 a pull request may close this issue.