es模块加载器用于React.js?

huangapple go评论72阅读模式
英文:

es module loader for React.js?

问题

我正在尝试将 supabase/auth-ui 添加到我的 React 项目。

https://github.com/supabase/auth-ui

我的运行时错误是:

./node_modules/@supabase/auth-ui-react/dist/index.es.js 1095:48
模块解析失败:意外的令牌 (1095:48)
文件已使用以下加载器进行处理:
 * ./node_modules/babel-loader/lib/index.js
您可能需要额外的加载器来处理这些加载器的结果。

我认为这意味着我无法处理 ES 模块。我需要一个 webpack 插件吗?

英文:

I am trying to add supabase/auth-ui to my react project

https://github.com/supabase/auth-ui

My runtime error is:

./node_modules/@supabase/auth-ui-react/dist/index.es.js 1095:48
Module parse failed: Unexpected token (1095:48)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.

I think this means that I cannot handle ES modules. Do I need a webpack plugin?

答案1

得分: 0

这些 tsconfig.json 中的数值解决了它:

"browserslist": {
    "production": [
        ">0.2%",
        "not dead",
        "not op_mini all"
    ],
    "development": [
        ">0.2%",
        "not dead",
        "not op_mini all"
    ]
}
英文:

These tsconfig.json values fixed it:

"browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ]
  },

huangapple
  • 本文由 发表于 2023年5月31日 23:37:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76375194.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定