qmlweb_parse is not defined
mrjoshuak opened this issue · 14 comments
Not sure how one is supposed to setup qmlweb with or without gulp, but following the Readmes on both projects leads me to this error:
> gulp
...
stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: /.../qmlweb_test/src/qml/main.qml: ReferenceError: qmlweb_parse is not defined
at Stream.modifyFile (/.../qmlweb_test/node_modules/gulp-qmlweb/index.js:26:33)
at Stream.stream.write (/.../qmlweb_test/node_modules/through/index.js:26:11)I have a gulpfile.js with the task, and requires from the example, and these devDependencies in package.json:
"gulp-qmlweb": "0.0.4",
"qmlweb": "^0.1.0",
"qmlweb-parser": "^0.2.0",I tried with and without the explicit "qmlweb-parser" dependency.
The gulp task for the above error looks like this:
var qml = require('gulp-qmlweb');
var concat = require('gulp-concat');
//...
gulp.task('qml', function() {
return gulp.src(['src/qml/**/*.qml', 'src/qml/**/*.js', 'src/qml/**/qmldir'])
.pipe(qml())
.pipe(concat('qrc.js'))
.pipe(gulp.dest('src/js'));
});Argh, it looks like I made a mistake in the last commit (ef1fd30).
Could you try replacing data = parser.qmlweb_parse(str, qmlweb_parse.QMLDocument); with data = parser.qmlweb_parse(str, parser.qmlweb_parse.QMLDocument); in ./node_modules/gulp-qmlweb/index.js and check if that works?
Yes that fixes this error.
v0.0.5 is out that fixes this bug.
v0.0.5 seems to have introduced new issues in index.js
@JoshuaKolden Argh. We definitely need tests here.
@JoshuaKolden Is it good now?
"gulp-qmlweb": "0.0.6"
> gulp
#...
TypeError: Cannot read property 'pathFilter' of undefined
at module.exports (/.../qmlweb_test/node_modules/gulp-qmlweb/index.js:6:23)@JoshuaKolden Argh! I couldn't test that atm, sorry.
Try passing an empty options object for now, i.e. .pipe(qml({})) — that should work. I will test things and push an update shortly.
Ok, that works as an interim solution. Though I'm still trying to figure out how to use all this properly, and I'm sure I have the wrong workflow. I can't seem to get precompiled qrc.js to supersede a client request for the qml file. And I'm not sure if it's using the precompiled qml or dynamically rendering the qml that is requested by the web page.
@JoshuaKolden Options object should be not necessary now, in v0.0.7.
Thanks. Any idea why I'd be getting No constructor found for TextField? Other QtQuck core options seem to work fine.
@JoshuaKolden No. Could you file a separate issue for that in https://github.com/qmlweb/qmlweb/, with a sample code to reproduce the issue?
Ok. Filed at: No constructor found #277