ReactJS: Uncaught SyntaxError: Unexpected token
UPDATE --
use this instead:
<script type="text/babel" src="./lander.js"></script>
Add type="text/jsx"
as an attribute of the script
tag used to include the JavaScript file that must be transformed by JSX Transformer, like that:
<script type="text/jsx" src="./lander.js"></script>
Then you can use MAMP or some other service to host the page on localhost so that all of the inclusions work, as discussed here.
Thanks for all the help everyone!
Reactjs - Uncaught SyntaxError: Unexpected token
I did moudule config in my base.js.
after many tries i can find the point, it is related to apache server configuration.
the htaccess file should be like this :
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
and in apache2.conf i should point the working directory directly to the source html files
like this (the contents of dist folder copied in "/var/www/html/")
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
Order allow,deny
allow from all
</Directory>
Related Topics
Javascript: Extract Video Frames Reliably
How to Change a <Select> Value from JavaScript
Setting Href Attribute at Runtime
How to Use Complex HTML with Twitter Bootstrap's Tooltip
Make HTML Text Input Field Grow as I Type
Jquery Click Anywhere in the Page Except on 1 Div
How to Manually Trigger Validation with Jquery Validate
Html5 Audio Tag on Safari Has a Delay
Document.Getelementsbyclassname().Innerhtml Always Returns "Undefined"
How to Determine If a Checkbox Is Checked
Display Unescaped HTML in Vue.Js
How to Add Months to a Date in JavaScript
How to Fix Navigator/Window/Document Is Undefined in Nuxt
How Does _Proto_ Differ from Constructor.Prototype
When Is the Comma Operator Useful
What Are Some Good Ways to Prevent People from Copying My Source Code