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.

turf@5.1.0 require is not defined

See original GitHub issue

When using <script src='https://npmcdn.com/@turf/turf/turf.min.js'></script>:

ReferenceError: require is not defined
turf.min.js:1
    at https://npmcdn.com/@turf/turf@5.1.0/turf.min.js:1:102072
    at https://npmcdn.com/@turf/turf@5.1.0/turf.min.js:1:140
    at https://npmcdn.com/@turf/turf@5.1.0/turf.min.js:1:153

testing before publishing wouldn’t hurt…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
DenisCarrierecommented, Dec 7, 2017

Already fixed… didn’t know about the require() (commit https://github.com/Turfjs/turf/commit/01796fe7ddde2a1401f3772700cd6a29697cd684)

1reaction
Spowncommented, Dec 7, 2017

I’ve just switched to npm and using .min version <script src="/static/js/lib/turf.min.js"></script> (which is copied from ./node_modules/@turf/turf/turf.min.js) seems to work fine. unminified version however is bugged. I’ll open another issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

require is not defined? Node.js - javascript - Stack Overflow
When I'm in my terminal and run node app.js , the console spits out 'running server!' , but in my browser I get,...
Read more >
Javascript - How to fix ReferenceError: require is not defined
Learn how you can fix JavaScript ReferenceError: require is not defined. Browser and Node.js environment.
Read more >
XSJS Unit Testing: require is not defined - SAP Community
Dear All, I am trying to test a .xsjs file via Unit Testing, but the test spec cannot locate the .xsjs file (please...
Read more >
Uncaught ReferenceError: require is not defined : r/electronjs
Hi I upgrade my electron from 3.1.8 to latest 7.1.1, and now i have this error: Uncaught ReferenceError: require is not defined ....
Read more >
Long-Term Pavement Performance Inventory Data Collection ...
This report does not constitute a standard, specification, or regulation. ... Inventory data sheet 1A is required for every SPS project or GPS...
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