[英]I cannot display a page of my website, i tried debugging Uncaught Syntax Error 1: import { useState } from 'react'
A page on my site is not showing on my localhost.我网站上的某个页面没有显示在我的本地主机上。 I do not understand why.
我不明白为什么。
The Home page is displayed correctly:主页正确显示:
J'arrive bien à afficher l'index.js J'arrive bien à afficher l'index.js
but when i click Sell Digital Asset it doesn't work... Nothing is displayed, we just have the header:但是当我单击“出售数字资产”时它不起作用...没有显示任何内容,我们只有 header:
Just the header like the home page就像主页一样的header
when I do a debug on create-item.js
(the file of the page i want display) it gives me this:当我在
create-item.js
(我想要显示的页面文件)上进行调试时,它给了我这个:
/usr/local/bin/node ./pages/create-item.js
Process exited with code 1
Uncaught SyntaxError ...(personal information)/pages/create-item.js:1
import { useState } from 'react'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
Does someone have an idea?有人有想法吗? thank you
谢谢你
Regards, Max问候,最大
Add to your package.json:添加到您的 package.json:
"type": "module"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.