Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrey Konovalenko
9,409 Pointssub url dose'not work in react-router project
Hi. I have problem with rendering sub url in react-router project.
After I added <Route path="/teachers" component={Featured} /> in App.js And put sub url in browser: http://localhost:9000/teachers/alena Featured component dose not render at all. React dose not work. And I have Uncaught SyntaxError: Unexpected token < in bundle.js:1 file but bundle.js has the following form:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="public/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
...
Andrey Konovalenko
9,409 PointsAndrey Konovalenko
9,409 PointsI found the way to solve the problem. I adde <base href="/" /> tag to my index.html file. But I still do not understand why it helps, and what I should change in my webpack.config.js file or app.js to fix this issue without adding a new tag to index.html file My webpack.config.js
My app.js
my server.js