Comments (15)
We can do a check on the window
but that's not always safe..
if (typeof window === 'undefined') {
nodejs = true;
}
from weld.
a try catch around https://github.com/hij1nx/weld/blob/master/lib/weld.js#L61-64 should do the trick, you up to it?
from weld.
Tried that but didn't work. Still throws that error for some reason... Think it's something in Browserify that forces the error.
(might be doing something wrong as I am still a beginner with Node.js)
Could ask Substack to change Browserify so it allows for try/catch
from weld.
try this syntax exactly:
(require)("weld")
from weld.
Same error even with that syntax...
var weld = (require)("weld").weld;
from weld.
I figured this out, should have a patch pretty quick.
from weld.
We need this patch in Nodejitsu admin for some secret stuff ;) Current implementation is breaking stuff and I have to jump through some hoops to get it running in production.
Could you patch this in the NPM module?
from weld.
im not sure exactly what are you talking about, can you gist the patch you need?
from weld.
if (typeof require !== 'undefined') {
var tty = require('tty');
if (tty.isatty && tty.isatty(0)) {
// if this is still a browser, they are trying really hard.
nodejs = true;
}
}
This does not work in the browser because browserify does not allow require('tty')
. So instead I am using a very simple check:
if (typeof window !== 'undefined') nodejs = true;
from weld.
hey, any update on a patch for this yet? Whats the best workaround in the mean time to get this working in browserify? The problem is checking for require doesn't discriminate between server/client when running a script loader such as browserify.
from weld.
this is fixed in 76b9821
from weld.
Hmm, Its not fixed. Still getting the Error: No wrapper for core module tty
message when requiring it through browserify.
Thanks
from weld.
@tmpvar hey, you overwrote my fix with your fix, so im assuming your fix must have been better than mine =) looks like it didn't get tested completely?
from weld.
which one of your commits did I overwrite?
from weld.
i cant remember, but the idea i had for checking against node was...
(process && process.title === 'node')
from weld.
Related Issues (20)
- Numeric values do not show up unless converted to strings HOT 4
- jQuery plugin: selector should limit the elements to work on. HOT 3
- Is there an easy way to populate element's attribute? HOT 12
- How can I integrate jquery-mobile? HOT 5
- Doesn't recognise JSON numbers HOT 3
- Doesnt handle empty strings properly
- map provides null parent HOT 6
- Weld ignores tagets with multiple occurrences HOT 2
- How to weld <a href="/thepath" class ="mylink">hello</a> HOT 3
- Server side weld with ruby HOT 6
- typo: contributors
- npm install warning HOT 3
- Is it possible to weld nested arrays? HOT 1
- Weld doesn't work with JS bundlers built on node. HOT 6
- Appending new data HOT 3
- RequireJS issue with weld-min.js
- Project status? HOT 4
- map and access to the row data
- Weld with virtual-dom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weld.