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

编译sourcemap出现错误 #11574

Closed
willxucn opened this issue Apr 3, 2022 · 1 comment · Fixed by #11621
Closed

编译sourcemap出现错误 #11574

willxucn opened this issue Apr 3, 2022 · 1 comment · Fixed by #11621
Assignees
Labels
bug Something isn't working F-react Framework - React T-swan Target - 编译到百度小程序 V-3 Version - 3.x
Milestone

Comments

@willxucn
Copy link

willxucn commented Apr 3, 2022

相关平台

百度小程序

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

复现步骤

注意,版本是3.4.4,但是open issue时,没有3.4.4的选项,但是确实是3.4.4的问题
系统是Windows 11
node版本 v16.13.2
NODE_ENV=develop情况下,执行 taro build --type swan --watch 就会报错。切换到production不会出现这个问题。

期望结果

正常编译结束

实际结果

| 正在编译...offset_sourcemap_lines_1.default is not a function

offset_sourcemap_lines_1.default is not a function

node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

TypeError: offset_sourcemap_lines_1.default is not a function
at TaroMiniPlugin.injectCommonStyles (D:\Users\WillXu\Source\Repos\MiniApp\tarojs331\saqs\node_modules@tarojs\mini-runner\src\plugins\MiniPlugin.ts:1190:43)
at TaroMiniPlugin. (D:\Users\WillXu\Source\Repos\MiniApp\tarojs331\saqs\node_modules@tarojs\mini-runner\src\plugins\MiniPlugin.ts:1007:10)
at Generator.next ()
at fulfilled (D:\Users\WillXu\Source\Repos\MiniApp\tarojs331\saqs\node_modules@tarojs\mini-runner\dist\plugins\MiniPlugin.js:5:58)

环境信息

👽 Taro v3.4.4


  Taro CLI 3.4.4 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.13.2 - D:\ProgramData\Miniconda3\envs\tarojs3\node.EXE
      npm: 8.1.2 - D:\ProgramData\Miniconda3\envs\tarojs3\npm.CMD

补充信息

3.4.3同一套代码,编译没这个问题,是升级到3.4.4后出现的。

升级通过taro update、taro update project并且删除了node_modules目录和lock文件再用npm install安装依赖。出现问题后,尝试再次删除node_modules和lock文件,故障依旧。

@taro-bot2 taro-bot2 bot added F-react Framework - React T-swan Target - 编译到百度小程序 V-3 Version - 3.x labels Apr 3, 2022
@fesiong
Copy link

fesiong commented Apr 11, 2022

遇到了相同的问题,看到 3.4.4 对 packages/taro-mini-runner/src/plugins/MiniPlugin.ts 进行了更改,引入了 import offsetLines from 'offset-sourcemap-lines' ,导致百度小程序编译失败,其他小程序编译正常,未知原因中

@Chen-jj Chen-jj self-assigned this Apr 11, 2022
@Chen-jj Chen-jj added the bug Something isn't working label Apr 12, 2022
@Chen-jj Chen-jj added this to the 3.4.5 milestone Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working F-react Framework - React T-swan Target - 编译到百度小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants