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

wepy2.x 引入 polyfill 运行时报错 #2236

Closed
nishino-tsukasa opened this issue Jul 10, 2019 · 9 comments
Closed

wepy2.x 引入 polyfill 运行时报错 #2236

nishino-tsukasa opened this issue Jul 10, 2019 · 9 comments
Assignees
Labels
2.0.x Version 2.0.x

Comments

@nishino-tsukasa
Copy link
Collaborator

引入 @babel/polyfill、babel-polyfill、core-js 的任意一个,运行时都会报错
在 wepy1.x 中没有问题,是不是 vendor 生成有问题
image

@Gcaufy Gcaufy self-assigned this Jul 11, 2019
@Gcaufy Gcaufy added the 2.0.x Version 2.0.x label Jul 11, 2019
@Gcaufy
Copy link
Collaborator

Gcaufy commented Jul 13, 2019

更新一下 cli 的版本试试看

npm i @wepy/cli@next

@nishino-tsukasa
Copy link
Collaborator Author

@Gcaufy 这个 cli 不行
会导致打包出来的 vendor 有问题
image
原因是你的这个 commit
fix: fixed erro require in npm component Gcaufy 2019-07-13 23:51
不太懂你这个属性 ctx.component 是想处理什么
是想把 npm 纯 js 打包到 vendor,npm 的 component 就不打包?

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jul 14, 2019

是的。 npm 的 js 会打包到 vendor.js ,npm 的 weapp component 会打包到 $vendor/xxx 中去

@Gcaufy
Copy link
Collaborator

Gcaufy commented Jul 14, 2019

是否有demo 方便我还原一下?

@nishino-tsukasa
Copy link
Collaborator Author

nishino-tsukasa commented Jul 14, 2019

@Gcaufy
就你给的 demo,然后升到最新的 cli
安装:npm i -S ramda
在 app 里:
import * as R from 'ramda'
运行,你就能看到报错
也可以去 vendor.js 里搜索:__wepy_require(undefined)

Gcaufy added a commit that referenced this issue Jul 15, 2019
@Gcaufy
Copy link
Collaborator

Gcaufy commented Jul 18, 2019

@nishino-tsukasa 这个问题是否解决了呢?

@nishino-tsukasa
Copy link
Collaborator Author

@Gcaufy 你没有发版吧,现在 cli 是 alpha.14

@nishino-tsukasa
Copy link
Collaborator Author

@Gcaufy 升到了 16 还是没有解决

@nishino-tsukasa
Copy link
Collaborator Author

@Gcaufy 升到 17 解决了,关贴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0.x Version 2.0.x
Projects
None yet
Development

No branches or pull requests

2 participants