Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save valera-rozuvan/4cf3933b97e002f1f8a8361db3a1236b to your computer and use it in GitHub Desktop.
Save valera-rozuvan/4cf3933b97e002f1f8a8361db3a1236b to your computer and use it in GitHub Desktop.
https://medium.com/@_rchaves_/building-microfrontends-part-i-creating-small-apps-710d709b48b7
Trying the commands after the sentence "That's it, you can now run the header with:".
--------------------------
Valeras-MacBook-Air:header valerarozuvan$ npm run build
> header@0.1.0 build /Users/valerarozuvan/dev/experiments/micro_f_01/header
> react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
47.65 KB build/static/js/main.74d57421.js
109 B build/static/css/main.65027555.css
The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Valeras-MacBook-Air:header valerarozuvan$ npm run transpile
> header@0.1.0 transpile /Users/valerarozuvan/dev/experiments/micro_f_01/header
> NODE_ENV=production babel src --out-dir transpiled --presets react-app
src/App.js -> transpiled/App.js
src/App.test.js -> transpiled/App.test.js
src/index.js -> transpiled/index.js
src/registerServiceWorker.js -> transpiled/registerServiceWorker.js
Valeras-MacBook-Air:header valerarozuvan$ npm run start:prod
> header@0.1.0 start:prod /Users/valerarozuvan/dev/experiments/micro_f_01/header
> NODE_ENV=production node server.js
/Users/valerarozuvan/dev/experiments/micro_f_01/header/transpiled/App.js:1
(function (exports, require, module, __filename, __dirname) { import React from 'react';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:537:28)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/valerarozuvan/dev/experiments/micro_f_01/header/server.js:5:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! header@0.1.0 start:prod: `NODE_ENV=production node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the header@0.1.0 start:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/valerarozuvan/.npm/_logs/2017-08-28T08_52_06_645Z-debug.log
Valeras-MacBook-Air:header valerarozuvan$ node --version
v8.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment