0

I wanted to test out path.js in jsfiddle, so I decided to make a 2-3 line jsfiddle script. I included path.min.js as an external resource, but when I try running it, I see errors that the join function is not defined.

This was the error message:

Uncaught ReferenceError: join is not defined

Outside of jsfiddle, normally I would:

var path = require('path');
path.join("a","b");

So I am thinking join("a","b","c"); is not the right usage for this kind of 'import', or maybe just for the path.min.js library in specific.

I've tried both path.js and path.min.js from cdnjs (the latter is what jsfiddle selects when using the search bar in its resources tab), and had the same error with both.

  • What you linked is some random routing library, it has nothing to do with Node `path` module, if that's what you want. – DallogFheir Jul 28 '23 at 19:28
  • @DallogFheir Yes, I am trying to use the Node `path` module, should have read the description on cdnjs. Would the only option be to do one of the options in [this post?](https://stackoverflow.com/questions/9841026/reference-github-file-in-jsfiddle/29121908#29121908) (I would just use [npm's link](https://github.com/jinder/path) to the `path` source on git.) – Reuben Frank Jul 30 '23 at 23:30

0 Answers0