Linked Questions
11 questions linked to/from Cannot use import statement outside a module
0
votes
1
answer
12k
views
Uncaught SyntaxError: Cannot use import statement outside a module for sample file [duplicate]
I have a folder for test only that contain only 3 file
index.js
sample.js
index.html
Index.html
<!DOCTYPE html>
<html>
<head>
<script src="index.js"></...
-1
votes
1
answer
1k
views
how to solve 'SyntaxError: Cannot use import statement outside a module' [duplicate]
in my script.js
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.4.1/firebase-app.js";
import { getDatabase, ref, set, child, get } from "https://www.gstatic.com/...
-1
votes
1
answer
574
views
SyntaxError: Cannot use import statement outside a module when running it in live server [duplicate]
//this is the greet.js file
import React from "react";
function Greet()
{
return (
<div><h1>Welcome</h1></div>
)
}
export default Greet
//This is the indx....
1
vote
1
answer
277
views
Why home is not defined? [duplicate]
I am not sure why home is not defined when i do this in app.js? I tried to reference home.js with app.js by adding code
import {home} from "home.js";
into app.js but then i got an error ...
0
votes
1
answer
51
views
Importing React Components [duplicate]
I have php page and import React as s file
<div id="app"></div>
<script src="/assets/app.js"></script>
in app.js file
const container = document....
72
votes
3
answers
102k
views
ES6 module Import giving "Uncaught SyntaxError: Unexpected identifier"
For a personal project, I'm trying to use ES6 import to write cleaner code. As first test, I'm writing an object that should generate a menu. The whole code is working when I'm directly loading up the ...
11
votes
1
answer
49k
views
JavaScript function Import not working
I am trying to import a function from a separate .js file. When I declare the import command the page is not executing the code. But when I delete the import command and execute a simple alert('Hello')...
2
votes
2
answers
2k
views
ReactJS inside .NET framework project - Cannot use import statement outside a module
I've tried to use reactJS inside .net framework MVC application.
View:
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-...
3
votes
1
answer
1k
views
Vue.js and The Movie Database API returns error 403
I am new to The Movie Database API. I created a Vue project and when I npm run serve and go to my localhost I see my app for 1 second and after that, I get a 403 with this error:
403 ERROR The ...
1
vote
0
answers
44
views
How to add react to my existing node website?
I built a react app and now I try to add to to my website which is created with nodejs. I use fastify as framework. Is it possible to add just my react app to a single page of my website in a specific ...
-3
votes
1
answer
34
views
Why can not I get the input of these fields? JavaScript
I have created a contact Form and I try to get the data of the name, email and message inputs trough a function when I trigger the Send Message button but the data do not print them out, are null, why?...