-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[bug] getStorageSync is not a function in TypeScript 5, PNPM 8 & webpack 5.77 #13586
Comments
vue3版本有同样的问题,Taro.request、Taro.getSystemInfo啥的也是提示这个未找到。同时vue-router也不能用了,打开路径变为/#/pages/index/index,3.6.2版本没有这个尾巴。 |
This comment was marked as off-topic.
This comment was marked as off-topic.
babel 插件导出 API 缺失错误,可通过以下方法临时修复 h5: {
webpackChain (chain) {
const rules = chain.module.rules
const script = rules.get('script')
const babelLoader = script.uses.get('babelLoader')
babelLoader.set('options', {
...babelLoader.get('options'),
plugins: [
[require('babel-plugin-transform-taroapi'), {
packageName: '@tarojs/taro',
// https://unpkg.com/browse/@tarojs/plugin-platform-h5@3.6.2/dist/taroApis.js
apis: require('./taroApis')
}]
]
})
}
} |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
3.6.9-aplha.6 依旧存在这个问题 楼上的方法不管用,而且 // https://unpkg.com/browse/@tarojs/plugin-platform-h5@3.6.2/dist/taroApis.js 这个文件从 3.6.8 开始就消失了,不见了,搜索整个 node_modules/@tarojs 目录都找不到 |
同楼上,目前其他npm包引用的内容有比较好的转化方法吗, |
4.0.4 依然有这个问题 |
import {getStorageSync} from "@tarojs/taro"; const getCookie = (k: string): string => { 4.0.4版本,Cannot resolve symbol 'getStorageSync' ? |
相关平台
H5
复现仓库
idea2app/Taro-Vant-MobX-ts#6
复现步骤
用
pnpm dev h5
启动后,点 demo 主导航栏最后一个图标,代码会执行期望结果
没有报错,让接口逻辑可以正常执行。
实际结果
环境信息
补充信息
运行时
import
的对象与此相同:#12943 (comment)The text was updated successfully, but these errors were encountered: