score:1
the problem is how you include the scripts in your html, not anything js or react related.
your script source is relative - ./path-to-script
; this makes it dependent on the url. so from page domain.com/examplea
the path to script is domain.com/path-to-script
, but as soon as you add another level in the url, or even just a slash, the relative path changes. for example, domain.com/examplea/
produces the path domain.com/examplea/path-to-script
.
you should instead use an absolute path. simply removing the .
at the beginning is enough for most cases. starting the source path with a /
implies that its at the root level of the domain. so a source at /path-to-source
will always yield domain.com/path-to-script
no matter what the url is.
so for your use case, it appears your scripts need to be changed to
<script src="/covid19/static/js/2.8cd0c9f0.chunk.js"></script>
<script src="/covid19/static/js/main.05f82414.chunk.js"></script>
Source: stackoverflow.com
Related Query
- No trailing slash on React not being handled
- react router trailing slash not working
- Why is getInitialState not being called for my React class?
- componentDidMount() not being called when react component is mounted
- React Native Navigation Error: The action navigate with payload {"name": 192.168.100.189:19000", "params":{}} was not handled by any navigator
- CSS class selector styles not being applied in React Project
- Express Session Cookie Not Being Set when using React Axios POST Request
- SetupProxy file not being read in Create React App Typescript
- list.map not being displayed in React Component
- Why React Router NavLink prop exact (v5) vs. end (v6) lead to different result with trailing slash in url
- React Apollo first object from subscription not being merge into previous data it actually gets removed
- does not contain a default export even after being correctly imported in React
- react script not being loaded
- React `componentDidCatch` not being called but required to handle error?
- React JSX not being recognized?
- React controlled radio buttons not being checked
- React event listener with throttle not being removed
- React and Tailwind CSS: dynamically generated classes are not being applied
- D3 line chart component not being updated inside useEffect in React
- Why is this code giving a warning about functions not being valid as a React child?
- Mocking Axios with Jest in React - mock function not being called
- React component is not being displayed on browser, getting empty screen
- React - component state not being set
- ReactJs retains multiple react values and do not reset state after being refreshed
- In react class component why is the state not being changed in the first instance of button click? But in the second instance it gets updated?
- React Material UI ThemeProvider not being applied
- React Router Switch routes not being matched
- React - Inline dynamic component style not being updated onMouseOver and onMouseOut events
- React complement not being read
- React hooks: useEffect not being triggered on array of objects
More Query from same tag
- How to stop overflow of elements in a multi column in React?
- How to stop setInterval() in React
- Export default works, but export anything else does not in React
- undefined variables react tutorial
- input type date format not working in chrome
- Can URLSearchParams get param case insensitive?
- styled-components: The component ... has been created dynamically
- npm linked local library requires node_modules while git linked libarary (same) doesn't
- How to store multiple values under the same field on Firestore?
- Using getDerivedStateFromProps to fetch API data is causing the component to render many times
- How to iterate over * (star) imported modules from index file
- Yup /w Formik File Upload Validation
- How get a thumbnail in node.js axios from Autodesk Forge
- How to attach drag event handlers to a React component using TypeScript
- npm package "watch" giving "no such file or directory" error
- Two logical operators for the disabling the button
- Jest unable to resolve alias used in SASS file in React project
- React CSS Transition Group, not working?
- Generate dynamic PDF with React
- How integrate JS external resource in React project (Marketo)
- React onsubmit change depreciated refs to updated code
- Use useEffect to manage the state in React
- TypeError: Cannot read property 'summary' of undefined React Js
- Hovering an article to make GatsbyImage scale
- Remove an existing item from array, when adding the same item
- React Native: XCode: Build failed with error "EMFILE: too many open files, watch"
- TypeError: (0 , _ApiCalls.default) is not a function jest tesing the axios call
- How to access react-bootstrap panel collapse state in panel title?
- How to search nested property in sails js rest api
- ag-grid with custom filter for date field react