Can't add DataUnlocker script to Nextjs project
Closed this issue · 5 comments
I tried to add DataUnlocker script to Nextjs project.
So instead of adding the script to .html
file as your tutorial, it should be added in _document.js of Nextjs project.
But I got a bunch of VSCode errors after added. Project also failed to start.
I made an empty Nextjs project to add DataUnlocker script as an example: https://github.com/huongpanprices/dataunlocker-nextjs
It would be great to get your support. Thanks.
Hello! Thanks for filing the issue.
Please check vercel/next.js#1413 and let me know whether it helped.
Thanks!
This happens because encoded script has `
symbol which needs to be escaped. I.e. you need to CTRL+R all the code and replace it with \`
. You will also need to escape some other symbols and backslashes :)
It's better to use unencoded script in your case:
...or use Continuous Integration option in your CI pipeline which will properly modify the output HTML file made by NextJS.
Works well now. Thanks for your help. :D
You're welcome! Happy DataUnlocking! :)