Giter Site home page Giter Site logo

Comments (11)

rickmed avatar rickmed commented on May 8, 2024 1

so the problem was in webpack.config.babel in windows, match.script is not matching the npm script name, so I replaced the function with process.env.npm_lifecycle_event === "web:dev" and got passed the error, but then I got

C:\Users\rickm\Documents\Google Drive\Projects\NodeJS\rfx-stack\src\shared\app.js:34
var uri = ['http://', config.io.host, ':', config.io.port].join('');
^

TypeError: Cannot read property 'io' of undefined

and got tired of debugging :)

EDIT: ookaayyy gave it another shot and there was indeed cross OS env shenanigans going on so I installed cross-env and change package.json to "web:dev": "cross-env NODE_ENV=development node ./run/start.web.js"

and it worked (I'm on win 10), cheers

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

I didn't used the stack on a window machine. However I don't know if this issue it's related to the OS.
But certainly is related to the webpack-dev-middleware package, and it's similar to these issues:

I think you should ask there.

But first, you can try to edit the output.path of /webpack/config.client.dev.js:

from:

output: {
   path: '/',
   ...

to:

output: {
   path: path.join(Dir.public, 'build'),
   ...

If path.join() don't work either, try with path.resolve().

let me know if this worked.

from rfx-stack.

dariuspranskus avatar dariuspranskus commented on May 8, 2024

Thanks @foxhound87, I tried that, but it did not help. I tried also to put a line like

export function config() {
  console.log(path.join(Dir.public, 'build'));

and I see no output. It is like it's breaking somewhere before it hits that line. But I run launched an Ubuntu VM will try there.

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

The webpack config file is loaded from the hot-middleware in /src/web/middleware/hot.js using babel-root-import:

import config from '~/webpack.config.babel';

so I think ther's something still not working on the babel-root-import with the Windows-Filesystem support:
https://github.com/michaelzoidl/babel-root-import/issues?utf8=%E2%9C%93&q=window

I suggest to remove the package and replace all the imports from '~/ with the relative real path.

...or try one of these packages instead:

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

@dariuspranskus let me know if you fixed it

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

@dariuspranskus this issue can be caused also by the node env vars, consider using this for cross platform support: https://www.npmjs.com/package/cross-env

from rfx-stack.

FerminYang avatar FerminYang commented on May 8, 2024

I have the same issue on Windows 10. And I also tried the cross-env, still not working.

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

@FerminYang Thank you for your hint.

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

@rickmed please, can you test the last commit on windows? I made some changes, still using the match.script() but I changed the implementation. That's a very strange behavior.

from rfx-stack.

rickmed avatar rickmed commented on May 8, 2024

@foxhound87 it works

from rfx-stack.

foxhound87 avatar foxhound87 commented on May 8, 2024

@rickmed thank you for your support! issue closed! 4c139ea

from rfx-stack.

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.