single-spa / single-spa-examples

Examples of single-spa applications.
https://single-spa.surge.sh
MIT License
359 stars 128 forks source link

Gettin build error #44

Closed nutan06 closed 6 years ago

nutan06 commented 6 years ago

I am getting build error while running the single-spa-examples code. The Webpack example runs nicely but getting issue when 2 versions of angular are added. Can you explain a bit on single-spa-examples or how to use multiple versions of angular in simple-single-spa-webpack-example. I didnt get how to create seperate package.json.

Thanks in advance

joeldenning commented 6 years ago

What error are you getting building the code?

Here are a few different ways two pull off separate package.json files for each child application:

Let me know if you'd like more details on any of that.

Somewhat related, and maybe helpful:

nutan06 commented 6 years ago

Thank you for the quick respnse. I will try with seperate package.json as mentioned.After downloading the single-spa-example if I try to run it I get following error

image

joeldenning commented 6 years ago

I was able to reproduce this -- it looks like you might not have run npm install before running npm start and opening it up in the browser. See https://github.com/CanopyTax/single-spa-examples#how-to-get-the-examples-running-locally for the instructions. When you do npm install, it should automatically create a build directory and create all of those files that are not being found in your stacktrace. The way it is doing it is with a postinstall hook here. If for some reason, that post install hook is not running after you do npm install, you can manually trigger it by doing npm run postinstall after you do npm install.

Try this:

npm install
npm run postinstall # Should get run automatically at the end of install, but just in case it isn't you can do it manually like this.
npm start
# Now open up http://localhost:8080 in the browser
nutan06 commented 6 years ago

Will try this .Thank you very much for prompt response. I appreciate this.

nutan06 commented 6 years ago

Followed all the instructions above. Now I am getting 404 error.

image

joeldenning commented 6 years ago

Can you verify if you have a build directory? It should have been created during npm run postinstall. Here's what my single-spa-examples repo looks like after doing the npm install (notice the build directory):

screen shot 2017-11-08 at 11 26 25 am

If you do not have a build directory, your npm install or npm run postinstall must have failed. Try running npm run build to see if it creates the build directory. If you get any errors in the terminal running those commands, let me know because that would prevent the build directory from being created properly.

nutan06 commented 6 years ago

Yes I do have similar thing but I see following error in my cmd prompt.

image

Can you get what this error is.I am new to jspm and trying to understand it.

nutan06 commented 6 years ago

This is what I get after npm install

image

nutan06 commented 6 years ago

@joeldenning got the issue,I am running this on windows . Facing similar issues as mentioned below: https://github.com/CanopyTax/single-spa-examples/issues/40 It worked when tried on mac. So how do I rectify this in windows?

joeldenning commented 6 years ago

@nutan06 apologies for the (very) slow response, but this should now be fixed (see #40). Closing this for now, let me know if you still have issues!