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

HTTPS协议下出现 app.js:1 Uncaught TypeError: o.default._set$app is not a function #3624

Closed
kennir opened this issue Jul 2, 2019 · 8 comments
Assignees

Comments

@kennir
Copy link

kennir commented Jul 2, 2019

问题描述
[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]

编译成h5版本后出现

app.js:1 Uncaught TypeError: o.default._set$app is not a function
at new App (app.js:1)
at mountComponent (app.js:1)
at ComponentWrapper.init (app.js:1)
at createElement (app.js:1)
at mountVNode (app.js:1)
at Object.render (app.js:1)
at Object. (app.js:1)
at webpack_require (app.js:1)
at Object. (app.js:1)
at webpack_require (app.js:1)

错误

复现步骤
[复现问题的步骤]

删除node, 删除/usr/local/lib/node_modules

安装node:

brew install node
cnpm install -g @tarojs/[email protected] 
taro init test
cd test
cnpm install
cnpm run build:h5
// 这里可以贴代码
// 点击链接查看如何插入代码:
// https://coding.net/help/doc/project/markdown.html#i-5

// ```js
// 代码放这里(前后的 "```" 有助 Mardown 整理代码格式和加入代码高亮)
// ```

// 提供完整可复现的代码和整理好代码格式,有助于我们快速定位问题,节省你我时间。
// 代码提供不全或代码格式混乱的 issues 【有可能被忽略】,烦请各位注意。

期望行为
[这里请用简洁清晰的语言描述你期望的行为]
正常出现web页面

报错信息

app.js:1 Uncaught TypeError: o.default._set$app is not a function
at new App (app.js:1)
at mountComponent (app.js:1)
at ComponentWrapper.init (app.js:1)
at createElement (app.js:1)
at mountVNode (app.js:1)
at Object.render (app.js:1)
at Object. (app.js:1)
at webpack_require (app.js:1)
at Object. (app.js:1)
at webpack_require (app.js:1)

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

╰─➤  taro info
👽 Taro v1.2.23


  Taro CLI 1.2.23 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.5.0 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 1.2.23 => 1.2.23
      @tarojs/plugin-babel: 1.2.23 => 1.2.23
      @tarojs/plugin-csso: 1.2.23 => 1.2.23
      @tarojs/plugin-sass: 1.2.23 => 1.2.23
      @tarojs/plugin-uglifyjs: 1.2.23 => 1.2.23
      @tarojs/router: 1.2.23 => 1.2.23
      @tarojs/taro: 1.2.23 => 1.2.23
      @tarojs/taro-alipay: 1.2.23 => 1.2.23
      @tarojs/taro-h5: 1.2.23 => 1.2.23
      @tarojs/taro-swan: 1.2.23 => 1.2.23
      @tarojs/taro-tt: 1.2.23 => 1.2.23
      @tarojs/taro-weapp: 1.2.23 => 1.2.23
      @tarojs/webpack-runner: 1.2.23 => 1.2.23
      eslint-config-taro: 1.2.23 => 1.2.23
      eslint-plugin-taro: 1.2.23 => 1.2.23
      nervjs: ^1.3.9 => 1.4.3

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

我同样试过1.3.4,也出现了同样的问题

@taro-bot
Copy link

taro-bot bot commented Jul 2, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@Garfield550
Copy link
Collaborator

你好,先将 Taro Cli 和依赖版本升级到 1.3.4 再试一下

@kennir
Copy link
Author

kennir commented Jul 2, 2019

👽 Taro v1.3.4


  Taro CLI 1.3.4 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.16.0 - ~/.nvm/versions/node/v8.16.0/bin/node
      npm: 6.4.1 - ~/.nvm/versions/node/v8.16.0/bin/npm
    npmPackages:
      @tarojs/components: 1.3.4 => 1.3.4
      @tarojs/plugin-babel: 1.3.4 => 1.3.4
      @tarojs/plugin-csso: 1.3.4 => 1.3.4
      @tarojs/plugin-sass: 1.3.4 => 1.3.4
      @tarojs/plugin-uglifyjs: 1.3.4 => 1.3.4
      @tarojs/router: 1.3.4 => 1.3.4
      @tarojs/taro: 1.3.4 => 1.3.4
      @tarojs/taro-alipay: 1.3.4 => 1.3.4
      @tarojs/taro-h5: 1.3.4 => 1.3.4
      @tarojs/taro-swan: 1.3.4 => 1.3.4
      @tarojs/taro-tt: 1.3.4 => 1.3.4
      @tarojs/taro-weapp: 1.3.4 => 1.3.4
      @tarojs/webpack-runner: 1.3.4 => 1.3.4
      eslint-config-taro: 1.3.4 => 1.3.4
      eslint-plugin-taro: 1.3.4 => 1.3.4
      nerv-devtools: ^1.4.3 => 1.4.3
      nervjs: ^1.4.3 => 1.4.3

我把node降级到和文档里一样的8.x的版本了,还是一样的问题

@luckyadam
Copy link
Member

没有复现,请提供 demo

@kennir
Copy link
Author

kennir commented Jul 2, 2019

test.zip

node_modules太大我移除了,可以看一下我编译出来的dist目录下的文件

@kennir
Copy link
Author

kennir commented Jul 2, 2019

更新:

我发现https连接不行,http可以,但是另外的taro的项目https也可以,nginx配置应该是一样的,在同一个根目录下

@kennir kennir changed the title app.js:1 Uncaught TypeError: o.default._set$app is not a function HTTPS协议下出现 app.js:1 Uncaught TypeError: o.default._set$app is not a function Jul 2, 2019
@luckyadam luckyadam added the H5 label Jul 2, 2019
@taro-bot taro-bot bot assigned Littly Jul 2, 2019
@taro-bot
Copy link

taro-bot bot commented Jul 2, 2019

CC @Littly

@Littly
Copy link
Contributor

Littly commented Aug 25, 2019

如果是http或https的问题,那已经不是taro的范畴了,检查下服务器配置/cdn缓存之类吧。

@Littly Littly closed this as completed Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants