在服务器上部署React App时,获得在模块外无法使用导入语句
因此,我正在尝试在远程服务器上部署我的React应用程序。 我已经在服务器上上传了我的构建和.htaccess 但是,当我运行网站时,我只会得到一个空白屏幕。
控制台日志给我以下错误:
uckulting语法:无法在模块外使用导入语句(在app.js:1:1) index.js:1
uckulting语法:意外的令牌'export'(在index.js:1:1)
我尝试在package.json文件上使用“ type”:“ type”:“模块”,但最终遇到了相同的错误。
我在这里做错了什么?
So I am trying to deploy my react app on a remote server.
I have uploaded both my build and .htaccess on the server
But when I run the website, I just get a blank screen.
The console log gives me the following error:
Uncaught SyntaxError: Cannot use import statement outside a module (at App.js:1:1)
index.js:1Uncaught SyntaxError: Unexpected token 'export' (at index.js:1:1)
I tried using "type":"module" on my package.json file but ended getting the same error.
What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论