-
Notifications
You must be signed in to change notification settings - Fork 71
Browserify SyntaxError: Unexpected character '�' (2:2) #46
Comments
I ran the browserify command on my CI Server(Linux) and I got the same error. So this issue is probably not a platform specific encoding error. |
Hi @Noah-Huppert. What command or code are your running that generates this error? |
The repository for the code is Noah-Huppert/Polymer-Markdown-Tag. I encounter this error using the browserify cli( |
I have opened an issue for the package that is actually causing this error |
I just ran into the same error using sassify and browserify. var browserify = require('browserify');
var gulp = require('gulp');
var source = require("vinyl-source-stream");
var reactify = require('reactify');
var debug = require('gulp-debug');
var babelify = require('babelify');
var sassify = require('sassify');
gulp.task('browserify', function(){
//init browserify with entry and transform
var b = browserify({
"debug": true,
"extensions": [".jsx", ".scss"]
})
.transform(babelify)
.transform(sassify, {
'auto-inject': false, // Inject css directly in the code
base64Encode: true, // Use base64 to inject css
sourceMap: true // Add source map to the code
});
b.add('server/middleware/react.js');
b.bundle()
.pipe(source('index.js')) //read docs for source, index.js is placeholder
.pipe(process.stdout);
//return source('server/middleware/react.js')
// .pipe(debug());
}); Update: I think this may be the result of a binary / hex image coming down the pipeline. I was able to filter some out like this. module.exports = function (file, opts) {
opts = opts || {};
return through(function (buf, enc, next) {
var binHex = /\.(jpg|jpeg|png|gif|svg)\b/.test(file);
if (!binHex) {
this.push(processRequires(buf.toString('utf8'), opts));
} else {
this.push(null);
}
next();
});
}; |
this seems like an upstream problem with |
Opened an issue with |
There are two things preventing mark-markdown from working in the browser.
oniguruma is "Native Node bindings to the Oniguruma regular expressions library." Translation: it's in C++. Ain't never gonna work in browserify.
Browserify's "require" has no .resolve method. My proposed solution is as follows:
I've got a hacked demo working on my desktop, will make a pull request shortly. |
Nice Update: |
cc @bcoe, who was working on a JS port of oniguruma back in the day. |
Ooooooooooo man. This is gonna be so cool! |
When I try and use Marky-Markdown with Browserify I get the following error
This appears to be an issue with a dependency of Marky-Markdown.
OS: Windows 8.1
The text was updated successfully, but these errors were encountered: