Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack5启动时报告Invalid option from onResolve() callback in plugin "scanImports": "importer" #13767

Closed
suerta-git opened this issue May 1, 2023 · 31 comments · Fixed by #13768 or #13915
Labels
A-runner Area - Webpack runner 相关
Milestone

Comments

@suerta-git
Copy link

相关平台

微信小程序

小程序基础库: 无关
使用框架: React

复现步骤

  • 在代码中import json、css等外部资源
  • 使用@tarojs/webpack5-runner 3.6.6版本
  • taro build --type weapp --watch

期望结果

无错误

实际结果

报错

环境信息

Taro CLI 3.6.6 environment info:
    System:
      OS: macOS 12.6.2
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
      npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.6 => 3.6.6 
      @tarojs/components: 3.6.6 => 3.6.6 
      @tarojs/helper: 3.6.6 => 3.6.6 
      @tarojs/plugin-framework-react: 3.6.6 => 3.6.6 
      @tarojs/plugin-html: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-alipay: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-h5: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-jd: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-qq: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-swan: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-tt: 3.6.6 => 3.6.6 
      @tarojs/plugin-platform-weapp: 3.6.6 => 3.6.6 
      @tarojs/react: 3.6.6 => 3.6.6 
      @tarojs/runtime: 3.6.6 => 3.6.6 
      @tarojs/shared: 3.6.6 => 3.6.6 
      @tarojs/taro: 3.6.6 => 3.6.6 
      @tarojs/webpack5-runner: 3.6.6 => 3.6.6
      babel-preset-taro: 3.6.2 => 3.6.2 
      eslint-config-taro: 3.6.2 => 3.6.2 
      react: ^18.0.0 => 18.0.0 
    npmGlobalPackages:
      typescript: 5.0.2

补充信息

报错是因为这里的实现有问题,args里包含importer字段,但是返回结果不允许包含除这些之外其他字段。

@ctq123
Copy link

ctq123 commented May 3, 2023

+1

@pear1958
Copy link

pear1958 commented May 3, 2023

+1 怎么解决呢?

@suerta-git
Copy link
Author

@zhangzy56 先降级@tarojs/webpack5-runner到3.6.5

@smithyj
Copy link

smithyj commented May 4, 2023

+1

@smithyj
Copy link

smithyj commented May 4, 2023

降级之后出现这个错误,TypeError: (0 , p.initAppInfo) is not a function

@ZakaryCode ZakaryCode added the A-runner Area - Webpack runner 相关 label May 4, 2023
@ZakaryCode
Copy link
Contributor

该问题将在下一个版本修复,当前可以通过以下方法规避:

  1. 禁用 prebundle,或者通过 prebundle.exclude 跳过对应依赖编译
  2. webpack5-runner 降级

降级之后出现这个错误,TypeError: (0 , p.initAppInfo) is not a function

类型问题,可以忽略,也可以在 typing 文件夹下新增依赖跳过该问题,参考这里

@ZakaryCode ZakaryCode added this to the 3.6.7 milestone May 4, 2023
@hxlniada
Copy link
Contributor

hxlniada commented May 5, 2023

+1

1 similar comment
@pluveto
Copy link

pluveto commented May 14, 2023

+1

@dzcpy
Copy link

dzcpy commented May 22, 2023

+10086

1 similar comment
@darin-lao
Copy link

+10086

@kaikidd
Copy link

kaikidd commented May 27, 2023

升级到Taro v3.6.7,dev:weapp 还是会出现 devInvalid option from onResolve() callback in plugin "scanImports": "importer"。

@lchjczw
Copy link

lchjczw commented May 27, 2023

升级到Taro v3.6.7,这个问题还是有

@Kennytian
Copy link

升级到3.6.7问题依旧存在

@yoyo837
Copy link
Contributor

yoyo837 commented May 29, 2023

  compiler: {
    type: 'webpack5',
    // https://github.com/NervJS/taro/issues/13271
    prebundle: {
      enable: false,
    },
  },

关闭 prebundle 可临时跳过

@yoyo837 yoyo837 reopened this May 29, 2023
@yoyo837
Copy link
Contributor

yoyo837 commented May 29, 2023

#13768 does not fix this.

@mdddj
Copy link

mdddj commented Jun 1, 2023

  • 1

@chenxinbin
Copy link

+1

@Adherentman
Copy link

升级到3.6.7问题依旧存在

@yoyo837
Copy link
Contributor

yoyo837 commented Jun 2, 2023

待下一个版本发布

@violet0sea
Copy link

[ERROR] [plugin scanImports] Invalid option from onResolve() callback in plugin "scanImports": "importer" 依然存在

@hxlniada
Copy link
Contributor

hxlniada commented Jun 4, 2023

升级到3.6.7问题依然存在

@tutuxxx
Copy link
Contributor

tutuxxx commented Jun 7, 2023

image

3.6.7

@smoothdvd
Copy link
Contributor

升级到3.6.8后,

compiler: {
    type: 'webpack5',
    prebundle: {
      enable: false,
    },
  },

会报如下错误

Taro 配置有误,请检查! (/Users/alexgao/Dev/chengshi-app/apps/chengshi-news-taro/config/index.js)
  [✗] compiler 的值 {"prebundle":{"enable":false,"exclude":[{}],"include":["react","react-dom","react/jsx-runtime","@tarojs/plugin-framework-react/dist/runtime"]},"type":"webpack5"} 不符合类型要求

@wangkuan0818
Copy link

升级到3.6.8后,

compiler: {
    type: 'webpack5',
    prebundle: {
      enable: false,
    },
  },

会报如下错误

Taro 配置有误,请检查! (/Users/alexgao/Dev/chengshi-app/apps/chengshi-news-taro/config/index.js)
  [✗] compiler 的值 {"prebundle":{"enable":false,"exclude":[{}],"include":["react","react-dom","react/jsx-runtime","@tarojs/plugin-framework-react/dist/runtime"]},"type":"webpack5"} 不符合类型要求

处理了吗?我也遇到这个问题了

@hbwow
Copy link

hbwow commented Jun 26, 2023

+1

2 similar comments
@ShaoGongBra
Copy link
Contributor

+1

@huaixu751
Copy link

+1

@Mrcxt
Copy link

Mrcxt commented Jul 14, 2023

这bug怎么关了,解决了吗

@one-thing-one-world
Copy link

请问下这个问题是怎么解决的啊,整了两天了。。。。。

@smoothdvd
Copy link
Contributor

升到3.6.10解决

@MrChen2016-08-27
Copy link

3.6.11还是报这个错,引入本地less文件就会

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runner Area - Webpack runner 相关
Projects
None yet