Giter Site home page Giter Site logo

Comments (8)

bdefore avatar bdefore commented on July 28, 2024

note the double slash before src/routes ... can you gist your
universal-redux.config.js ?

On Monday, December 21, 2015, Bartol Karuza [email protected]
wrote:

After running npm run dev on the babel 6 version ("universal-redux":
"2.0.0-beta3") I'm getting the following stack trace:

[1] /Users/bartolkaruza/Development/Projects//src/routes.js:1
[1](function %28exports, require, module, __filename, __dirname%29 { import React from 'react';
[1] ^^^^^^
[1]
[1] SyntaxError: Unexpected token import
[1] at exports.runInThisContext %28vm.js:53:16)
[1] at Module._compile (module.js:404:25)
[1] at Object.Module._extensions..js (module.js:432:10)
[1] at Module.load (module.js:356:32)
[1] at Function.Module._load (module.js:311:12)
[1] at Module.require (module.js:366:17)
[1] at require (module.js:385:17)
[1] at setupRenderer (/Users/bartolkaruza/Development/Projects//node_modules/universal-redux/lib/server.js:106:19)
[1] at Function.setup (/Users/bartolkaruza/Development/Projects//node_modules/universal-redux/lib/server.js:283:7)
[1] at Object. (/Users/bartolkaruza/Development/Projects//node_modules/universal-redux/bin/server.js:12:12)
[1]

β€”
Reply to this email directly or view it on GitHub
#14.

from universal-redux.

bartolkaruza avatar bartolkaruza commented on July 28, 2024

https://gist.github.com/bartolkaruza/052f33816af3ebb62294

from universal-redux.

bartolkaruza avatar bartolkaruza commented on July 28, 2024

double slashes are from removed project names :)

from universal-redux.

bartolkaruza avatar bartolkaruza commented on July 28, 2024

I'm trying to find the issue now, locally it does not seem to pick up any babel configuration (or cli runtime) when invoking bin/server.js. bin/server.js then reaches out to react and es6 code in the project using universal-redux.
I'm trying now to use babel-node in the npm command for starting the dev-server;

"betterScripts": {
    "dev-server": {
      "command": "cd node_modules/universal-redux && babel-node ./bin/server.js"
    },
    "build": {
      "command": "universal-redux-build",
      "env": {
        "NODE_PATH": "./src",
        "NODE_ENV": "production"
      }
    },
    "watch-client": {
      "command": "universal-redux-watch",
      "env": {
        "NODE_PATH": "./src",
        "UV_THREADPOOL_SIZE": 100
      }
    }
  }

which leads to:
ReferenceError: [BABEL] /Users/bartolkaruza/Development/Projects//node_modules/react-redux/lib/index.js: Unknown option: base.stage
I'm thinking this has to do with missing babel preset dev dependencies in the project. I'm trying to add them next. Considering that you mentioned that those are no longer necessary in the dependent projects, I think I'm missing the intended approach for es6 on the server side in the dev server setup.

from universal-redux.

bdefore avatar bdefore commented on July 28, 2024

@bartolkaruza do you have babel@5 installed globally? if so, can you try again after an npm uninstall -g babel?

also, you shouldn't need to run babel-node or cd into universal-redux to run the server. try either universal-redux-server or model after the JWT example on babel6 branch https://github.com/bdefore/universal-redux/blob/babel6/examples/jwt/package.json

i notice the following warning during npm install when trying it with the node version you mention, 5.0.0:

npm WARN engine [email protected]: wanted: {"npm":"^3.3.9"} (current: {"node":"5.0.0","npm":"3.3.6"})

...but it does appear to work. I notice that I need to run npm run dev, stop, then run again for the server to be responsive. That's an issue I'll look into today.

from universal-redux.

bdefore avatar bdefore commented on July 28, 2024

Also, if you can push a branch of your 2.0.0-beta3 example I may be able to diagnose better.

from universal-redux.

bdefore avatar bdefore commented on July 28, 2024

@bartolkaruza i fixed an issue with universal-redux-server, published an update to 2.0.0-beta4, and left you a small PR that updates to 2.0 and works on my side: bartolkaruza/universal-redux-simple-example#2

from universal-redux.

bartolkaruza avatar bartolkaruza commented on July 28, 2024

Everything is working fine now, thanks!

from universal-redux.

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.