After upgrading Gulp, javascript is throwing an syntax-error “import declarations may only appear at top level of a module” #2447
Unanswered
magic-john
asked this question in
Help
Replies: 3 comments 3 replies
-
@magic-john that looks like your issue is coming from a plugin. Did you upgrade your plugins at the same time? I also moved this to Discussions since plugins are a support question. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you. Yes I did upgrade everything along with gulp. Which plugin would it be or how can I find out the cause? |
Beta Was this translation helpful? Give feedback.
3 replies
-
@phated any other ideas? My code is failing even when I am only using
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a
gulpfile.js
that watch file changes in a folder. Everything was working fine until I upgraded from Gulp 3.9.1 to 4.0.2.Here is my gulp task that bundles the js files
The task generates the following code
But the line
import { setTimeout } from "timers";
is throwing the following errorI tried changing
<script src="my-module.js"></script>
to<script type="module" src="my-module.js"></script>
Now I get the following error
Please provide the following information:
node -v
): v12.17.0npm -v
): 6.13.1gulp -v
): 4.0.2 (CLI version 2.2.1)Beta Was this translation helpful? Give feedback.
All reactions