App icon indicating copy to clipboard operation
App copied to clipboard

External contributor instructions don't work for web on Windows

Open dylmye opened this issue 5 years ago • 12 comments

Hi, I've followed the instructions in your README here and have set everything up fresh. When I run npm run proxy I see this in CLI:

> [email protected] proxy ...\Expensify.cash
> node proxy.js & webpack-dev-server --open --config config/webpack/webpack.dev.js --env.proxy=true

Proxy server listening at http://localhost:9000

Navigating to http://localhost:9000 redirects me to expensify.com. I've followed all the steps (though if I'm supposed to set up ngrok, the linked stackoverflow is private)

Please let me know how to set up the project as an external contributor. Thank you :)

(PS: on Windows 10, Firefox and Edge Chromium)

dylmye avatar Dec 23 '20 22:12 dylmye

If I try to run npm run web instead, I get this error: image

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    at Module.<anonymous> (global.js:20)
    at Module../node_modules/webpack/buildin/global.js (app-9843bb43b85a977c7960.bundle.js:189676)

dylmye avatar Dec 23 '20 22:12 dylmye

Thanks, just saw the updated README today. I've copied the latest production env file and switch use_web_proxy to true.

The page I get redirected to now is https://www.expensify.com/?exitTo=inbox&email=

(also happy holidays & new year to anyone reading this :) )

dylmye avatar Dec 24 '20 21:12 dylmye

@dylmye thanks for creating this proactively! are you sorted or is this still an issue for you?

laurenreidexpensify avatar Dec 30 '20 14:12 laurenreidexpensify

This is an issue for me as well.

henryrossiter avatar Dec 30 '20 23:12 henryrossiter

Hi @laurenreidexpensify, I'm still having this issue on the latest version of master ([email protected]).

It works fine on MacOS - localhost:8080 is launched when running npm run proxy and it is functional. However this behaviour does not occur on Windows.

dylmye avatar Dec 31 '20 00:12 dylmye

Related issue: #1125

dylmye avatar Dec 31 '20 01:12 dylmye

#1144 Solves this issue on my end.

henryrossiter avatar Dec 31 '20 18:12 henryrossiter

Hey @dylmye

Can you confirm -

  • That the error is still occurring
  • whether you have a proposed solution for fixing it?

Thanks!

laurenreidexpensify avatar Jan 29 '21 13:01 laurenreidexpensify

Going to close this since there hasn't been much activity.

marcaaron avatar Mar 31 '21 20:03 marcaaron

I'm getting the same error. The change to babel.config.js here #1144 fixes this for me too

Though you can add it like:

const webpack = {
    sourceType: 'unambiguous',

    env: {
        production: {
            presets: defaultPresets,
            plugins: [...defaultPlugins, 'transform-remove-console'],
        },
        development: {
            presets: defaultPresets,
            plugins: defaultPlugins,
        },
    },
};

I'm not sure what exactly causes this but looks like it's related to babel config in the root of the project - everything using babel internally might use it - I think webpack-dev-server uses it to compile stuff (it's socket client) internally

I don't have this problem for other projects where I'm using an earlier version of webpack and webpack-dev-server

Updating webback-dev-server (latest atm 3.11.2) didn't solve this

kidroca avatar Apr 01 '21 15:04 kidroca

To start the dev web server on windows edit the package.json like so:

    "web-server": "webpack-dev-server --open --config config/webpack/webpack.dev.js",
    "web-proxy": "node web/proxy.js",

And start the two processes separately on different terminals

  1. first npm run web-proxy in one terminal
  2. then npm run web in the other

The changes to sourceType: 'unambiguous', are also required under windows

I keep these changes in a separate stash and use them locally being careful not to commit them


The problem is under windows you can't use & to start processes in parallel There are npm packages that solve this like https://www.npmjs.com/package/concurrently

   "web": "concurrently \"npm:web-proxy\" \"npm:web-server\""
   "web-server": "webpack-dev-server --open --config config/webpack/webpack.dev.js",
   "web-proxy": "node web/proxy.js",

Edit:

Since concurrently is already installed this works for me:

    "web": "concurrently npm:web-proxy npm:web-server",
    "web-server": "webpack-dev-server --open --config config/webpack/webpack.dev.js",
    "web-proxy": "node web/proxy.js",

You might need to wrap "npm:web-proxy" and "npm:web-server" in quotes, it works without them for me

kidroca avatar May 21 '21 22:05 kidroca

image

end up with this error.

hiteshagja avatar Jan 20 '22 08:01 hiteshagja