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

can't start server in dev environment on mac OS X #2037

Closed
copremesis opened this issue May 13, 2016 · 8 comments
Closed

can't start server in dev environment on mac OS X #2037

copremesis opened this issue May 13, 2016 · 8 comments

Comments

@copremesis
Copy link

Sharetribe Version:

Share the git commit hash of the version of Sharetribe that you are using. You can find it by running git rev-parse HEAD in your Sharetribe directory.

6ca0d2ee4d527a81f616b0968b71bf35a16e33b5
Environment:

What's your environment? Mac OS X
Darwin ethereal.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

Homebrew 0.9.5 (git revision 3c896; last commit 2016-03-01)
bash-3.2$ node -v v0.10.33
bash-3.2$ npm -v 2.1.14

Server mode:

development

Description:

when attempting to run a job or server I'm getting this error message

ERROR when compiling base_js_code! See file tmp/base_js_code.js to correlate line numbers of error. Error is

Error: Cannot find module "./app/startup/serverRegistration"

webpackMissingModule ((execjs):79:43)
Object.<anonymous> ((execjs):79:114)
__webpack_require__ ((execjs):51:30)
Steps To Reproduce:

attempt any of the following:

rake jobs:work
foreman start -f Procfile.static

Any help would be greatly appreciated

@mporkola
Copy link
Contributor

Thanks for the report,

You seem to be running an old Node version, we currently require Node 6.1. This post on our forum might help you: https://www.sharetribe.com/community/t/help-webpack-and-react/151/2

@copremesis
Copy link
Author

copremesis commented May 13, 2016

now running


bash-3.2$ node -v
v6.1.0
bash-3.2$ npm -v
3.9.0

still getting

ethereal:sharetribe rob$ rake jobs:work
ERROR when compiling base_js_code! See file tmp/base_js_code.js to correlate line numbers of error. Error is

Error: Cannot find module "./app/startup/serverRegistration"

webpackMissingModule ((execjs):79:43)
Object.<anonymous> ((execjs):79:114)
__webpack_require__ ((execjs):51:30)

@rap1ds
Copy link
Member

rap1ds commented May 13, 2016

@mporkola Do you know why React on Rails is doing something when running normal rake command that is totally unrelated to React?

@copremesis
Copy link
Author

copremesis commented May 13, 2016

I think they have have it baked in here somehow .... no idea ... 1st time seeing anything like this but so anxious to see if it actually works

@mporkola
Copy link
Contributor

The issue is probably caused by missing JS bundle for server side React rendering. Rake also requires it, since it initialises the Rails environment for tasks. We were unable to reproduce your issue though, so I'm taking a couple of guesses which might help you.

You can try running the Webpack build manually:

cd client && npm run build:client && npm run build:server

This branch might help running the Procfile: #2046

Let me know if this helps!

@toao
Copy link

toao commented Jun 6, 2016

Similar issue here under Ubuntu 14.04.4 LTS:

Sharetribe-Version

7bcbce3cc03cb80260fa080381ffa8bee1bf732c (release 5.7.1)

Node

node -v
v6.1.0
npm -v
3.8.6

Problem 1

npm run build:client

> @ build:client /home/deploy/foobar/releases/initial/client
> webpack --config webpack.client.rails.build.config.js

Webpack dev build for Rails
Hash: ed4718dcb708b09359e8
Version: webpack 1.13.0
Time: 4954ms
           Asset       Size  Chunks             Chunk Names
   app-bundle.js  214 bytes       0  [emitted]  app
vendor-bundle.js    1.01 MB       1  [emitted]  vendor
   [0] multi app 28 bytes {0} [built] [1 error]
   [0] multi vendor 52 bytes {1} [built]
    + 301 hidden modules

ERROR in ./app/startup/clientRegistration.js
Module build failed: Error: Couldn't find preset "stage-2" relative to directory "/home/deploy/foobar/releases/initial/client"
    at /home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:17
    at Array.map (native)
    at OptionManager.resolvePresets (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:405:20)
    at OptionManager.mergePresets (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:388:10)
    at OptionManager.mergeOptions (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:347:14)
    at OptionManager.addConfig (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:248:10)
    at OptionManager.findConfigs (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:454:16)
    at OptionManager.init (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:502:12)
    at File.initOptions (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/index.js:243:89)
    at new File (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/index.js:159:72)
    at Pipeline.transform (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/pipeline.js:49:16)
    at transpile (/home/deploy/foobar/releases/initial/client/node_modules/babel-loader/index.js:14:22)
    at Object.module.exports (/home/deploy/foobar/releases/initial/client/node_modules/babel-loader/index.js:88:12)
 @ multi app

Problem 2

npm run build:server

> @ build:server /home/deploy/foobar/releases/initial/client
> webpack --config webpack.server.rails.build.config.js

Hash: 7b131a11d393e27ebf91
Version: webpack 1.13.0
Time: 3686ms
           Asset    Size  Chunks             Chunk Names
server-bundle.js  256 kB       0  [emitted]  main
   [0] multi main 40 bytes {0} [built] [1 error]
    + 299 hidden modules

ERROR in ./app/startup/serverRegistration.js
Module build failed: Error: Couldn't find preset "stage-2" relative to directory "/home/deploy/foobar/releases/initial/client"
    at /home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:413:17
    at Array.map (native)
    at OptionManager.resolvePresets (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:405:20)
    at OptionManager.mergePresets (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:388:10)
    at OptionManager.mergeOptions (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:347:14)
    at OptionManager.addConfig (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:248:10)
    at OptionManager.findConfigs (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:454:16)
    at OptionManager.init (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/options/option-manager.js:502:12)
    at File.initOptions (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/index.js:243:89)
    at new File (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/file/index.js:159:72)
    at Pipeline.transform (/home/deploy/foobar/releases/initial/client/node_modules/babel-core/lib/transformation/pipeline.js:49:16)
    at transpile (/home/deploy/foobar/releases/initial/client/node_modules/babel-loader/index.js:14:22)
    at Object.module.exports (/home/deploy/foobar/releases/initial/client/node_modules/babel-loader/index.js:88:12)
 @ multi main

Question/Clarify
Is there anything else to do except from the steps mentioned in the readme to let sharetribe run in production mode?

Currently Step 6 (bundle exec rake assets:precompile) is failing with the above errors which seems to be related to @copremesis problem.

@bladealslayer
Copy link
Member

Do you still have these issues with latest released version or latest master branch?

@mynkbhati22
Copy link

I am facing same error (Uncaught Error: Cannot find module 'process/browser') help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants