Coder Social home page Coder Social logo

Comments (14)

yangangzhang avatar yangangzhang commented on August 24, 2024

window.getPublicPath is not a function

子项目中是否有set-public-path.js,是否正确引入

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

set-public-path.js:1 Uncaught TypeError: window.getPublicPath is not a function
at Object../src/set-public-path.js (set-public-path.js:1)
at webpack_require (bootstrap:723)
at fn (bootstrap:100)
at Module../src/main.js (HelloWorld.vue?7a45:1)
at webpack_require (bootstrap:723)
at fn (bootstrap:100)
at Object.0 (Home.vue?3b23:1)
at webpack_require (bootstrap:723)
at bootstrap:790
at bootstrap:790

图片上传不了

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

直接项目下下来,按他步骤跑不起来

from coexisting-vue-microfrontends.

yangangzhang avatar yangangzhang commented on August 24, 2024

直接项目下下来,按他步骤跑不起来

  1. 截图直接可以拖拽到github上,自动上传
  2. 项目下载之后依赖是否安装正确,最好使用cnpm(重要)
  3. 对,就是先把项目下来,别接入自己的项目,跑不起来,报错是什么?

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

1.截图直接可以拖拽到github上,自动上传好像失效了,我这边传不上

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

项目我就是用cnpm装的,我没有接自己的项目就是他的项目跑不起来

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

你项目下载下来可以跑吗

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

image
image
现在图片可以上传了,之前可能网不好

from coexisting-vue-microfrontends.

wangxueyou110 avatar wangxueyou110 commented on August 24, 2024

发现问题了,是有个端口被占用了

from coexisting-vue-microfrontends.

yangangzhang avatar yangangzhang commented on August 24, 2024

image
image
现在图片可以上传了,之前可能网不好

  1. 刚才重新下载项目测试了一下,可以跑起来。
  2. 建议你删除所有的node_modules然后重新安装,在跑起来
  3. 这个项目问题还是不少的,可以研究,最好是使用淘宝qiankun技术方案

from coexisting-vue-microfrontends.

yangangzhang avatar yangangzhang commented on August 24, 2024

发现问题了,是有个端口被占用了

做微前端的项目,注意端口,因为从开发到部署,端口太多了,而且必须要严格kill

from coexisting-vue-microfrontends.

joeldenning avatar joeldenning commented on August 24, 2024

Note that I have updated this project to use systemjs-webpack-interop. This removed the getPublicPath function.

See 1253942 for more information.

from coexisting-vue-microfrontends.

wenwen1995 avatar wenwen1995 commented on August 24, 2024

@joeldenning , Hi,can you tell us why to use systemjs-webpack-interop and removed the getPublicPath function ? I cannot understand..The reason just is which can set the webpack public path "on the fly" to work with the dynamic url for the bundle in SystemJS' import map ? But it requires systemjs@>=6 and webpack@>=4.30.0...I think it's not a good way.

from coexisting-vue-microfrontends.

joeldenning avatar joeldenning commented on August 24, 2024

systemjs-webpack-interop has some features that getPublicPath did not, including ability to calculate a public path that is multiple directories above where the entry file is.

Using systemjs@6 is part of the core team's recommended setup, which is why it is encouraged in this repo.

Vue CLI uses webpack@>=4.30, so I don't see that as a problem.

You can read more about why we're doing this at all and the reasoning behind it at https://single-spa.js.org/docs/faq/#code-splits

from coexisting-vue-microfrontends.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.