buuing / lucky-canvas

🎖🎖🎖 基于 TS + Canvas 开发的【大转盘 / 九宫格 / 老虎机】抽奖插件,🌈 一套源码适配多端框架 JS / Vue / React / Taro / UniApp / 微信小程序等,🎨 奖品 / 文字 / 图片 / 颜色 / 按钮均可配置,支持同步 / 异步抽奖,🎯 概率前 / 后端可控,🚀 自动根据 dpr 调整清晰度适配移动端
https://100px.net
Apache License 2.0
7.61k stars 919 forks source link

taro-react 3.5.5 引入就报错 #328

Open HZZformGD opened 1 year ago

HZZformGD commented 1 year ago
// 代码开始, 别再放歪了行吗
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
{
  moduleIdentifier: '/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/index-984fd9e7.css',
  moduleName: './node_modules/.taro/weapp/prebundle/index-984fd9e7.css',
  loc: '1:0',
  message: 'Module parse failed: Unexpected token (1:0)\n' +
    'You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n' +
    '> .lucky-box {\n' +
    '|   position: relative;\n' +
    '|   overflow: hidden;',
  moduleId: './node_modules/.taro/weapp/prebundle/index-984fd9e7.css',
  moduleTrace: [
    {
      originIdentifier: '/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js',
      originName: './node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js',
      moduleIdentifier: '/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/index-984fd9e7.css',
      moduleName: './node_modules/.taro/weapp/prebundle/index-984fd9e7.css',
      dependencies: [
        { loc: '1790:0-30' },
        { loc: '2020:0-30' },
        { loc: '2279:0-30' }
      ],
      originId: './node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js',
      moduleId: './node_modules/.taro/weapp/prebundle/index-984fd9e7.css'
    },
    {
      originIdentifier: 'container entry (default) [["./react",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/react.js"]}],["./@lucky-canvas/taro/react",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js"]}],["./taro-hooks",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/taro-hooks.js"]}],["./@tarojs/taro",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@tarojs_taro.js"]}],["./@prequest/miniprogram",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@prequest_miniprogram.js"]}],["./@prequest/miniprogram-addon",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@prequest_miniprogram-addon.js"]}],["./react/jsx-runtime",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/react_jsx-runtime.js"]}],["./@tarojs/runtime",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@tarojs_runtime.js"]}],["./@tarojs/plugin-framework-react/dist/runtime",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js"]}],["./@tarojs/plugin-platform-weapp/dist/runtime",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js"]}],["./@tarojs/plugin-html/dist/runtime",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@tarojs_plugin-html_dist_runtime.js"]}],["./react-dom",{"import":["/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/react-dom.js"]}]]',
      originName: 'container entry',
      moduleIdentifier: '/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js',
      moduleName: './node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js',
      dependencies: [ { loc: './@lucky-canvas/taro/react[0]' } ],
      originId: 'webpack/container/entry/taro_app_library',
      moduleId: './node_modules/.taro/weapp/prebundle/@lucky-canvas_taro_react.js'
    }
  ],
  details: undefined,
  stack: 'ModuleParseError: Module parse failed: Unexpected token (1:0)\n' +
    'You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n' +
    '> .lucky-box {\n' +
    '|   position: relative;\n' +
    '|   overflow: hidden;\n' +
    '    at handleParseError (/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/webpack/lib/NormalModule.js:971:19)\n' +
    '    at /home/hzz/side_hustle/mini/shipai-mini-react/node_modules/webpack/lib/NormalModule.js:1090:5\n' +
    '    at processResult (/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/webpack/lib/NormalModule.js:795:11)\n' +
    '    at /home/hzz/side_hustle/mini/shipai-mini-react/node_modules/webpack/lib/NormalModule.js:855:5\n' +
    '    at /home/hzz/side_hustle/mini/shipai-mini-react/node_modules/loader-runner/lib/LoaderRunner.js:407:3\n' +
    '    at iterateNormalLoaders (/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/loader-runner/lib/LoaderRunner.js:233:10)\n' +
    '    at /home/hzz/side_hustle/mini/shipai-mini-react/node_modules/loader-runner/lib/LoaderRunner.js:224:4\n' +
    '    at /home/hzz/side_hustle/mini/shipai-mini-react/node_modules/webpack/lib/NormalModule.js:829:15\n' +
    '    at Array.eval (eval at create (/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)\n' +
    '    at runCallbacks (/home/hzz/side_hustle/mini/shipai-mini-react/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)'
}
// 代码结束
buuing commented 1 year ago

发一个zip格式的demo给我,要能浮现这个问题的

HZZformGD commented 1 year ago

发一个zip格式的demo给我,要能浮现这个问题的

麻烦看一下 mini-react.zip

HZZformGD commented 1 year ago

@buuing

buuing commented 1 year ago

好的, 晚上瞅瞅

HZZformGD commented 1 year ago

好的, 晚上瞅瞅

怎么说 哈哈哈 搞定

buuing commented 1 year ago

我还到家, 你那边好了?

HZZformGD commented 1 year ago

我还到家, 你那边好了?

巧了 没有。 我还没在车上 想回去看看的

buuing commented 1 year ago

你这个 demo 有问题, 但我重新创建了新的 demo 没问题, 所以, 我怀疑你改了哪里, 建议重新初始化

HZZformGD commented 1 year ago

你这个 demo 有问题, 但我重新创建了新的 demo 没问题, 所以, 我怀疑你改了哪里, 建议重新初始化

啥东西都没改呀。 会不会跟开发平台有关系哦。 我是window里面是wsl 你那边呢

buuing commented 1 year ago

我用的mac, taro-cli最新版, 用的默认模板

HZZformGD commented 1 year ago

我用的mac, taro-cli最新版, 用的默认模板

我看了一下。 貌似是某个css文件打包的时候的bug但是找不到深层的。身边没有mac电脑 有点难受 不知道mac环境会不会就没事了 你是用小程序环境还是H5? 我是小程序出现的bug

buuing commented 1 year ago

用的h5

HZZformGD commented 1 year ago

@buuing 我是在小程序上出个bug。。我还是没找到原因。 你试试你那边的小程序?

buuing commented 1 year ago

明天中午我试一下, 但是我觉得跟电脑系统无关, 可能你的依赖出问题, 或者nodejs版本, 或者是你选择的模板, 又或者是你的taro-cli版本有问题

ZhouHGit commented 1 year ago

我这边碰到了同样的问题,我把这个丢到小程序的分包里就好了。 但是目前碰到了另一个问题,无法阻止正在抽奖状态 继续点击抽奖

zhengzhou commented 1 year ago

遇到相同的问题, 我的环境: 👽 Taro v3.5.7

Taro CLI 3.5.7 environment info: System: OS: macOS 13.2.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.6.0 - ~/.nvm/versions/node/v18.12.1/bin/npm npmPackages: @tarojs/cli: 3.5.7 => 3.5.7 @tarojs/components: 3.5.7 => 3.5.7 @tarojs/helper: 3.5.7 => 3.5.7 @tarojs/plugin-framework-react: 3.5.7 => 3.5.7 @tarojs/plugin-platform-alipay: 3.5.7 => 3.5.7 @tarojs/plugin-platform-jd: 3.5.7 => 3.5.7 @tarojs/plugin-platform-qq: 3.5.7 => 3.5.7 @tarojs/plugin-platform-swan: 3.5.7 => 3.5.7 @tarojs/plugin-platform-tt: 3.5.7 => 3.5.7 @tarojs/plugin-platform-weapp: 3.5.7 => 3.5.7 @tarojs/react: 3.5.7 => 3.5.7 @tarojs/router: 3.5.7 => 3.5.7 @tarojs/runtime: 3.5.7 => 3.5.7 @tarojs/shared: 3.5.7 => 3.5.7 @tarojs/taro: 3.5.7 => 3.5.7 @tarojs/taro-h5: 3.5.7 => 3.5.7 @tarojs/webpack5-runner: 3.5.7 => 3.5.7 babel-preset-taro: 3.5.7 => 3.5.7 eslint-config-taro: 3.5.7 => 3.5.7 react: ^18.0.0 => 18.2.0

Jimmylxue commented 1 month ago

+1 之前还好好的 我 build:weapp 之后想再 dev:weapp 就报这个了 有解决方案吗

buuing commented 1 month ago

+1 之前还好好的 我 build:weapp 之后想再 dev:weapp 就报这个了 有解决方案吗

之前好好的, 那就往依赖方面排查一下, 是不是npm安装东西的时候, 把某些依赖也顺带着更新了

Jimmylxue commented 1 month ago

确实是没有,不过看了issue 有同学说先把那块的内容往分包上丢 确实就不会报这个错了, 如果有遇到同样问题的同学都试试这样先把

Jimmylxue commented 1 month ago

目前我这边测试下来是 dev模式会报错 build模式不会报错 报错内容实在是难以排查具体的原因 还是需要作者或其他大佬来看看这个问题