Repository: react-static/react-static

Issue #929: cli start error
Created: 2018-12-29T18:42:47Z
Are you reporting a bug?
Yes, maybe related to my environment
Problem description
The CLI command start returns an error on a newly created project.
MacBook-Pro-di-Matteo:rstatic6 matteo$ yarn start
yarn run v1.12.3
$ react-static start
  Error: Cannot find module 'react-static/babel-preset.js' from '/Users/matteo/D  ocuments/Development/rstatic6'
  
  - sync.js:43 Function.module.exports [as sync]
    [rstatic6]/[resolve]/lib/sync.js:43:15
  
  - plugins.js:101 resolveStandardizedName
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:101:31
  
  - plugins.js:58 resolvePreset
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:58:10
  
  - plugins.js:77 loadPreset
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:77:20
  
  - config-descriptors.js:154 createDescriptor
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:154:9
  
  - config-descriptors.js:109 items.map
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:109:50
  
  - Array.map
  
  - config-descriptors.js:109 createDescriptors
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:109:29
  
  - config-descriptors.js:101 createPresetDescriptors
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:101:10
  
  - config-descriptors.js:47 presets
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:47:19
  
  - config-chain.js:320 mergeChainOpts
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:320:26
  
  - config-chain.js:283 
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:283:7
  
  - config-chain.js:120 buildRootChain
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:120:22
  
  - partial.js:85 loadPrivatePartialConfig
    [rstatic6]/[@babel]/core/lib/config/partial.js:85:55
  
  - full.js:43 loadFullConfig
    [rstatic6]/[@babel]/core/lib/config/full.js:43:39
  
  - index.js:27 loadOptions
    [rstatic6]/[@babel]/core/lib/config/index.js:27:36
  
  - index.js:231 OptionManager.init
    [rstatic6]/[@babel]/core/lib/index.js:231:36
  
  - node.js:61 compile
    [rstatic6]/[@babel]/register/lib/node.js:61:42
  
  - node.js:102 compileHook
    [rstatic6]/[@babel]/register/lib/node.js:102:12
  
  - index.js:77 Module._compile
    [rstatic6]/[pirates]/lib/index.js:77:29
  
  - loader.js:700 Module._extensions..js
    internal/modules/cjs/loader.js:700:10
  
  - index.js:88 Object.newLoader [as .js]
    [rstatic6]/[pirates]/lib/index.js:88:7
  
  - loader.js:599 Module.load
    internal/modules/cjs/loader.js:599:32
  
  - loader.js:538 tryModuleLoad
    internal/modules/cjs/loader.js:538:12
  
  - loader.js:530 Function.Module._load
    internal/modules/cjs/loader.js:530:3
  
  - loader.js:637 Module.require
    internal/modules/cjs/loader.js:637:17
  
  - helpers.js:20 require
    internal/modules/cjs/helpers.js:20:18
  
  - getConfig.js:328 _callee3$
    [rstatic6]/[react-static]/lib/static/getConfig.js:328:22
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - getConfig.js:46 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/static/getConfig.js:46:103
  
  - getConfig.js:48 _next
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:194
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:364
  
  - new Promise
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:97
  
  - getConfig.js:346 buildConfigFromPath
    [rstatic6]/[react-static]/lib/static/getConfig.js:346:18
  
  - getConfig.js:368 _callee5$
    [rstatic6]/[react-static]/lib/static/getConfig.js:368:20
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - getConfig.js:46 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/static/getConfig.js:46:103
  
  - getConfig.js:48 _next
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:194
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:364
  
  - new Promise
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:97
  
  - getConfig.js:417 getConfig
    [rstatic6]/[react-static]/lib/static/getConfig.js:417:23
  
  - start.js:62 Object._callee3$
    [rstatic6]/[react-static]/lib/commands/start.js:62:42
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  

  Error: Cannot find module 'react-static/babel-preset.js' from '/Users/matteo/D  ocuments/Development/rstatic6'
  
  - sync.js:43 Function.module.exports [as sync]
    [rstatic6]/[resolve]/lib/sync.js:43:15
  
  - plugins.js:101 resolveStandardizedName
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:101:31
  
  - plugins.js:58 resolvePreset
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:58:10
  
  - plugins.js:77 loadPreset
    [rstatic6]/[@babel]/core/lib/config/files/plugins.js:77:20
  
  - config-descriptors.js:154 createDescriptor
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:154:9
  
  - config-descriptors.js:109 items.map
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:109:50
  
  - Array.map
  
  - config-descriptors.js:109 createDescriptors
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:109:29
  
  - config-descriptors.js:101 createPresetDescriptors
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:101:10
  
  - config-descriptors.js:47 presets
    [rstatic6]/[@babel]/core/lib/config/config-descriptors.js:47:19
  
  - config-chain.js:320 mergeChainOpts
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:320:26
  
  - config-chain.js:283 
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:283:7
  
  - config-chain.js:120 buildRootChain
    [rstatic6]/[@babel]/core/lib/config/config-chain.js:120:22
  
  - partial.js:85 loadPrivatePartialConfig
    [rstatic6]/[@babel]/core/lib/config/partial.js:85:55
  
  - full.js:43 loadFullConfig
    [rstatic6]/[@babel]/core/lib/config/full.js:43:39
  
  - index.js:27 loadOptions
    [rstatic6]/[@babel]/core/lib/config/index.js:27:36
  
  - index.js:231 OptionManager.init
    [rstatic6]/[@babel]/core/lib/index.js:231:36
  
  - node.js:61 compile
    [rstatic6]/[@babel]/register/lib/node.js:61:42
  
  - node.js:102 compileHook
    [rstatic6]/[@babel]/register/lib/node.js:102:12
  
  - index.js:77 Module._compile
    [rstatic6]/[pirates]/lib/index.js:77:29
  
  - loader.js:700 Module._extensions..js
    internal/modules/cjs/loader.js:700:10
  
  - index.js:88 Object.newLoader [as .js]
    [rstatic6]/[pirates]/lib/index.js:88:7
  
  - loader.js:599 Module.load
    internal/modules/cjs/loader.js:599:32
  
  - loader.js:538 tryModuleLoad
    internal/modules/cjs/loader.js:538:12
  
  - loader.js:530 Function.Module._load
    internal/modules/cjs/loader.js:530:3
  
  - loader.js:637 Module.require
    internal/modules/cjs/loader.js:637:17
  
  - helpers.js:20 require
    internal/modules/cjs/helpers.js:20:18
  
  - getConfig.js:328 _callee3$
    [rstatic6]/[react-static]/lib/static/getConfig.js:328:22
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - getConfig.js:46 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/static/getConfig.js:46:103
  
  - getConfig.js:48 _next
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:194
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:364
  
  - new Promise
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:97
  
  - getConfig.js:346 buildConfigFromPath
    [rstatic6]/[react-static]/lib/static/getConfig.js:346:18
  
  - getConfig.js:390 FSWatcher._callee4$
    [rstatic6]/[react-static]/lib/static/getConfig.js:390:32
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - getConfig.js:46 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/static/getConfig.js:46:103
  
  - getConfig.js:48 _next
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:194
  
  - getConfig.js:48 
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:364
  
  - new Promise
  
  - getConfig.js:48 FSWatcher.<anonymous>
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:97
  
  - events.js:182 FSWatcher.emit
    events.js:182:13
  
  - index.js:200 FSWatcher.<anonymous>
    [rstatic6]/[chokidar]/index.js:200:38
  
  - index.js:241 FSWatcher._emit
    [rstatic6]/[chokidar]/index.js:241:5
  
  - fsevents-handler.js:329 FSWatcher.<anonymous>
    [rstatic6]/[chokidar]/lib/fsevents-handler.js:329:12
  
  - fsevents-handler.js:378 FSWatcher.<anonymous>
    [rstatic6]/[chokidar]/lib/fsevents-handler.js:378:7
  

  TypeError: Cannot read property 'DIST' of undefined
  
  - start.js:85 _callee2$
    [rstatic6]/[react-static]/lib/commands/start.js:85:69
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - start.js:24 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/commands/start.js:24:103
  
  - start.js:26 _next
    [rstatic6]/[react-static]/lib/commands/start.js:26:194
  
  - start.js:26 
    [rstatic6]/[react-static]/lib/commands/start.js:26:364
  
  - new Promise
  
  - start.js:26 
    [rstatic6]/[react-static]/lib/commands/start.js:26:97
  
  - start.js:160 
    [rstatic6]/[react-static]/lib/commands/start.js:160:30
  
  - getConfig.js:394 FSWatcher._callee4$
    [rstatic6]/[react-static]/lib/static/getConfig.js:394:42
  
  - runtime.js:62 tryCatch
    [rstatic6]/[regenerator-runtime]/runtime.js:62:40
  
  - runtime.js:288 Generator.invoke [as _invoke]
    [rstatic6]/[regenerator-runtime]/runtime.js:288:22
  
  - runtime.js:114 Generator.prototype.(anonymous function) [as next]
    [rstatic6]/[regenerator-runtime]/runtime.js:114:21
  
  - getConfig.js:46 asyncGeneratorStep
    [rstatic6]/[react-static]/lib/static/getConfig.js:46:103
  
  - getConfig.js:48 _next
    [rstatic6]/[react-static]/lib/static/getConfig.js:48:194
  
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

Environment

react-static -V: 6.0.18
node -v: 10.9.0
npm -v: 6.5.0;
3b. yarn -v: 1.12.3;
Operating system: MacOs Mojave (10.14.1)
Browser and version (if relevant): -

Steps to Reproduce the problem

Just upgraded react-static to v6
I created a new project (basic template)
I tried to start it.

I'm almost sure it is bound to my environment, otherwise you would have already spotted it, but I cannot understand what could it be.

Duplicate issue #930: Error when starting dev server with global react-static CLI
Created: 2018-12-30T19:02:44Z
After running react-static start in a newly created project and visiting http://localhost:3000 I get the following message: Oh-no! Something’s gone wrong!
Detailed error output from Chrome: localhost-1546195846717.log
Using npm run start or npx react-static start works just fine.
Environment

react-static -V: 6.0.18
node -v: v10.14.2
npm -v: 6.4.1
Operating system: macOS 10.14.2

Steps to Reproduce the problem

Install react-static npm install -g react-static
Run react-static create. Create new-project and select basic template.
cd new-project && react-static start
Open browser at http://localhost:3000

Closing comment (2018-12-30T20:20:59Z): This should be fixed in the latest version and is likely related to #929