[Getting Started with React and AEM SPA Editor - Chapter 3] - Router error - Target container is not a DOM element.

Avatar

Avatar
Boost 1
Level 1
elizabethg83724
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Validate 1
Give Back
Ignite 1
View profile

Avatar
Boost 1
Level 1
elizabethg83724
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
Validate 1
Give Back
Ignite 1
View profile
elizabethg83724
Level 1

29-04-2021

Hello!

I am executing the AEM SPA react tutorial from the documentation below:

https://helpx.adobe.com/br/experience-manager/kt/sites/using/getting-started-spa-wknd-tutorial-devel...

 

I did everything as documentation is saying, except because I am using updated version to node and npm:

Node: v14.16.1

npm: 6.14.12

 

Everything is working fine until I install React Router, create RouteHelper.js and update index.js to to wrap the App with BrowserRouter and ScrollToTop components

When I do this, I start to get the error below on my react app (localhost:3000)

 

elizabethg83724_0-1619735838546.png

When I come back my application to state that was before the instalation of the React Router, everything works again.

 

Can someone help me? Thanks in advance!  

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

572 likes

Total Posts

716 posts

Correct reply

238 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

572 likes

Total Posts

716 posts

Correct reply

238 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

03-05-2021

Hi @elizabethg83724,

Could you please share details of the code on line 13 in index.js file.(The code where the initial error is reported. Per the screenshot posted in the query, initial error is on the line 13) Is it <ScrollToTop> or <BrowserRouter> ?

If possible, share the related code files to debug further. 

Answers (0)