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

Dynamic routes do not work in production build #1

Open
jobara opened this issue Jul 19, 2024 · 2 comments
Open

Dynamic routes do not work in production build #1

jobara opened this issue Jul 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jobara
Copy link

jobara commented Jul 19, 2024

Describe the bug

The dynamic routes used in the menu only work when running through the webpack-dev-server.
After running npm run build, the contents of the public folder do not have directories like /htp1, /level1, level2, etc (so they generate 404 errors when deployed to a production webserver).

It's as if the react-router-dom component is not working as expected for some reason. Tested with Chrome 83.

When it works:

  1. npm install
  2. npm run start
  3. open http://localhost:8888

When it fails:

  1. npm install
  2. npm run build
  3. python -m http.server --directory public
  4. open http://localhost:8888 -> click menu options

It seems that @waharnum had some problems creating a deployable unit in INFRA-217 as well.

Additionally, the UglifyJsPlugin from webpack 3.10.0 causes a build error. It's necessary to remove it from webpack.production.config.js to get a clean build (which still has the issue with the routes).

Additional context or notes

Migrated from FLUID-9527. Originally filed by @gtirloni on July 9, 2020

@jobara jobara added the bug Something isn't working label Jul 19, 2024
@jobara
Copy link
Author

jobara commented Jul 19, 2024

Comment Migrated from FLUID-9527 originally posted by @BlueSlug on July 14, 2020 at 3:09 AM

Once I'd removed the UglifyJsPlugin step from the webpack script, I was able to get the site built and running mostly properly by running server.js via the following actions:

  1. npm install
  2. npm run serve:build
  3. open http://localhost:8080

OR

  1. npm install
  2. npm run build
  3. node .\server.js
  4. open http://localhost:8080

I say "mostly properly" because almost none of the audio works any more, as all but one file were hosted on and imported from instaud.io. Only the "game over" sound is actually present in the repository, somewhat fittingly.

For context, my environment is:
Windows 10 Pro v1909
Chrome 83
Node v10.15.3
npm 6.4.1

@jobara
Copy link
Author

jobara commented Jul 19, 2024

Comment Migrated from FLUID-9527 originally posted by @gtirloni on July 14, 2020 at 7:56 AM

Should we consider this a dynamic website then with a live component (the express server)? I was hoping to just serve the contents of the public folder but it doesn't seem possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant