Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

reactjs - In react, when src directory symlinked from other directory within react app, throws rendor error

When we symliked src directory from somewhere, within react app throws error 'jsx' isn't currently enabled.

If the directory is not sym-linked, and instead, a regular directory, -- no problems.

Support for the experimental syntax 'jsx' isn't currently enabled (13:3):

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.

Steps to Reproduce in Linux OS,

Move src directory somewhere, create symlink by following commands.

sudo ln -s 'somewhere/src' 'react-app-project-path/src'

npm run start or yarn start

Throws below error

react-start-error


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...