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

(React)All response data is the content of index.html(after craco build,it was normal before build) #488

Closed
ChenKe404 opened this issue Feb 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ChenKe404
Copy link

What's happening
(React)All response data is the content of index.html(The same if the back-end server is not started)
response data:
<!doctype html><title>React App</title><script defer="defer" src="/static/js/main.b2a3add8.js"></script>You need to enable JavaScript to run this app.

What should happen
the data from server,like json or text

To reproduce

  1. craco build
  2. serve -s build
  3. axios request

CRACO version
(ex. 7.0.0)

CRACO config
const path = require('path')
const resolve = dir => path.resolve(__dirname, dir);
module.exports = {
webpack: {
alias: {
"@": resolve("src"),
}
}
}

package.json
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@craco/craco": "^7.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"antd": "^5.0.4",
"axios": "^1.2.1",
"http-proxy-middleware": "^2.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.4",
"react-scripts": "5.0.1",
"spark-md5": "^3.0.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},

Additional information
No

@ChenKe404 ChenKe404 added the bug Something isn't working label Feb 1, 2023
@ChenKe404
Copy link
Author

I'm stupid.

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