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

reference mistake #113

Closed
JoJo-Bear opened this issue Mar 12, 2018 · 5 comments
Closed

reference mistake #113

JoJo-Bear opened this issue Mar 12, 2018 · 5 comments

Comments

@JoJo-Bear
Copy link

When configuring with webpack and node I stumbled on an error with the osc-browser.js file.
Can't resolve '../osc.js'

when removing a single dot, making it ./osc.js , it will work

@colinbdclark
Copy link
Owner

Hi @JoJo-Bear, sorry to hear you had problems using osc.js. Unfortunately I don't have enough information to address the issue. Can you describe a bit more how you were using osc.js with Webpack? Error messages? Stack traces? Line numbers where you had to make changes? Anything that would help in identifying the issue?

Thanks very much!

@JoJo-Bear
Copy link
Author

Hi @colinbdclark,
The problem I found wad inside the osc-browser.js located in the dist folder
dist/osc-browser.js

Inside the file you have two references to osc.js one of them is

var osc = osc || require("../osc.js");

This is where my problem occures at line 1991.
The require should be the same as the other one
var osc = osc || require("./osc.js");
The problem and difference between these two files was a single dot to many in the filepath, that is actually all I had to change.

The only error message I received was Error: Can't resolve '../osc.js'
The error occured while trying to execute webpack.

I hope this helps you out.

@colinbdclark
Copy link
Owner

I'm not a user of Webpack, unfortunately, but my guess is that you probably shouldn't be using a pre-built distribution of osc.js if you're attempting to build it yourself. It sounds like Webpack is trying to do additional compilation steps on an already-built artefact. In other words, I don't think Webpack will successfully process files in the dist directory. The osc-browser.js file is intended to be used by linking it to your web application in the conventional manner using a standard script tag.

This comment describes how one user successfully used Webpack with osc.js, and may provide you with some insights for your use case.

I have an open ticket for adding Webpack-related documentation to osc.js, but since I am not a user of it myself, I'll need someone to contribute to it.

@colinbdclark
Copy link
Owner

This issue is definitely related #117, which was also encountered with Browserify. It's definitely an issue, at least with the default workflow for these bundlers, so we'll need a viable solution for these kinds of tools which expect to pre-process all requireed files in an aggressive way.

@colinbdclark
Copy link
Owner

I'm closing this issue due to inactivity. The need for a Webpack-specific tutorial is covered in #107.

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

No branches or pull requests

2 participants