0

I have simple Javascript project that builds correctly locally, and I get this result

Local build image

However, when I deploy it on netlify or run netlify deploy locally I get the image below from the draft URL

netlify deployment

In my netlify.toml file I have the following configuration

[build]
  command = "npm run build"
  publish = "dist"

[dev]
  command = "yarn start"
  targetPort = 3000
  port = 8888
  publish = "dist"

What could be the issue leading to that problem?

Ben
  • 139
  • 1
  • 2
  • 10

1 Answers1

0

I needed to remove the homepage key and value from the package.json because React uses this to build for relative paths.

Also I needed to delete publicPath key from webpack.config.js

After those changes, the build worked and the deployment was successfull

Ben
  • 139
  • 1
  • 2
  • 10