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

【v3.6.24】Webpack 持久化缓存配置,开启后,运行pnpm dev:weapp 后,控制台:[webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: #15314

Closed
liangskyli opened this issue Mar 7, 2024 · 5 comments · Fixed by #15316 or #15361
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@liangskyli
Copy link

相关平台

微信小程序

使用框架: React

复现步骤

npx @tarojs/cli@3.6.24 init myApp 初始化后,config/index.ts 里配置cache: {
enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
},
运行pnpm dev:weapp
控制台错误显示:
[webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Can't resolve '/Users/xxx/myApp/app.config' in '/Users/xxx/myApp'
while resolving '/Users/xxx/myApp/app.config' in /Users/xxx/myApp as file
at resolve commonjs /Users/xxx/myApp/app.config

期望结果

控制台不报错

实际结果

控制台报错

环境信息

👽 Taro v3.6.24


  Taro CLI 3.6.24 environment info:
    System:
      OS: macOS 14.1.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.14.0 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 8.19.3 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.24 => 3.6.24 
      @tarojs/components: 3.6.24 => 3.6.24 
      @tarojs/helper: 3.6.24 => 3.6.24 
      @tarojs/plugin-framework-react: 3.6.24 => 3.6.24 
      @tarojs/plugin-html: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-alipay: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-h5: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-jd: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-qq: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-swan: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-tt: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-weapp: 3.6.24 => 3.6.24 
      @tarojs/react: 3.6.24 => 3.6.24 
      @tarojs/runtime: 3.6.24 => 3.6.24 
      @tarojs/shared: 3.6.24 => 3.6.24 
      @tarojs/taro: 3.6.24 => 3.6.24 
      @tarojs/taro-loader: 3.6.24 => 3.6.24 
      @tarojs/webpack5-runner: 3.6.24 => 3.6.24 
      babel-preset-taro: 3.6.24 => 3.6.24 
      eslint-config-taro: 3.6.24 => 3.6.24 
      react: ^18.0.0 => 18.2.0 


补充信息

这个提交导致的问题:https://github.com/NervJS/taro/pull/15227/files

image
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 7, 2024
@liangskyli
Copy link
Author

@Hector-Chong 有空看下这个问题

@Hector-Chong
Copy link
Contributor

@Hector-Chong 有空看下这个问题

复现 repo?

@liangskyli
Copy link
Author

@Hector-Chong 有空看下这个问题

复现 repo?

npx @tarojs/cli@3.6.24 init myApp 初始化后,config/index.ts 里配置cache: {
enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
},

运行pnpm dev:weapp 即可

@liangskyli
Copy link
Author

liangskyli commented Mar 8, 2024

@Hector-Chong 有空看下这个问题

复现 repo?

提交了临时的 https://github.com/liangskyli/taro-demo/tree/taro-cache-bug

# 安装依赖
pnpm i

# 运行复现
pnpm dev:weapp

@Hector-Chong
Copy link
Contributor

感谢,已修复。

正在创建 PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants