Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where can I find support for using browserify? #1983

Open
snyxan opened this issue Oct 13, 2020 · 3 comments
Open

Where can I find support for using browserify? #1983

snyxan opened this issue Oct 13, 2020 · 3 comments

Comments

@snyxan
Copy link

snyxan commented Oct 13, 2020

Hi. there,

I'm using browserify to bundle up some Nodejs file into a pure javascript file so that I can use them in a react project. I've met many bugs while using it and can't find the right place for help. Is there any group I can join to ask questions? Is IRC still active? I cannot join that channel btw.

@ljharb
Copy link
Member

ljharb commented Oct 14, 2020

The #browserify channel on freenode still exists and can certainly be joined; there's also the #node.js channel on freenode that has plenty of help available.

An issue here is probably fine too, but more focused questions are likely more appropriate than broader ones.

@snyxan
Copy link
Author

snyxan commented Oct 14, 2020

Got it. So I'm trying to bundle up some file depending on several NodeJS modules (e.g. voxel-engine, voxel-player). When I run browserify world.js -o myWorld.js and try to import some functions from myWorld.js in a React Project. It gave me the following errors:

./src/components/VoxelWorld/myWorld.js
  Line 45546:7:  Parsing error: Deleting local variable in strict mode

  45544 |     }, function() {
  45545 |       self._afterLoading();
> 45546 |       delete canvases;
        |       ^
  45547 |       self.materials = self.materials.concat(textures);
  45548 |       cb(textures);
  45549 |     });

Looks like it's complaining about the syntax of the bundled js file. What should I do about it? Any hint would be really appreciated!

@ljharb
Copy link
Member

ljharb commented Oct 14, 2020

delete of a non-global variable is always an error; it's just that in strict mode, the language throws an exception. I suggest just deleting that line entirely, if it's in first-party code.

If it's not, then it seems like somehow that code is being ran in strict mode, which no non-ES-Module or non-class code should be by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants