question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't add DataUnlocker script to Nextjs project

See original GitHub issue

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.

Screen Shot 2021-02-24 at 11 18 32 PM

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ZitRoscommented, Feb 24, 2021

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:

image

…or use Continuous Integration option in your CI pipeline which will properly modify the output HTML file made by NextJS.

0reactions
ZitRoscommented, Feb 24, 2021

You’re welcome! Happy DataUnlocking! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic Features: Handling Scripts - Next.js
The Script component, next/script , allows you to optimally load third-party scripts anywhere in your Next.js application. It is an extension of the...
Read more >
Next 11 and adding Script tags not working. No scripts are ...
I added my google tag manager to _app.js file, and its not showing. None of the scripts I am loading via the new...
Read more >
Best practices to increase the speed for Next.js apps
An application's speed is strongly related to the amount of time it takes to serve the application code, styles, and data to the...
Read more >
Build a blog with Next (React.js) and Strapi
Now, you can create your Next.js application to fetch our content from ... with some added security for easily fetch the data in...
Read more >
Build a Node.js and React app with npm - Jenkins
Fork and clone the sample repository; Create your Pipeline project in Jenkins ... directory inside the container to the Docker volume named jenkins-data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found