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

Illegal require generation #81

Open
syuilo opened this issue Apr 2, 2016 · 1 comment
Open

Illegal require generation #81

syuilo opened this issue Apr 2, 2016 · 1 comment

Comments

@syuilo
Copy link

syuilo commented Apr 2, 2016

e.g.

// Generated by LiveScript 1.4.0
var $, Sortable, uploadFile, sncompleter, postContentInitializer, postCompiler, subPostCompiler, AlbumDialog, userCard, Post, Timeline;
$ = require("./..\\..\\..\\..\\..\\bower_components\\jquery\\dist\\jquery");
require("./..\\..\\..\\..\\..\\bower_components\\jquery.transit\\jquery.transit.js");
Sortable = require("./..\\..\\..\\..\\..\\bower_components\\Sortable\\Sortable.js")
require("./..\\..\\..\\..\\..\\bower_components\\Sortable\\ng-sortable.js")
require("./..\\..\\..\\..\\..\\bower_components\\Sortable\\knockout-sortable.js")
require("./..\\..\\..\\..\\..\\bower_components\\Sortable\\react-sortable-mixin.js")ploadFile = require('../../../common/upload-file.ls');
sncompleter = require('./sncompleter.ls');
postContentInitializer = require('./post-content-initializer.ls');
postCompiler = require('../views/post/smart/render.jade');
subPostCompiler = require('../views/post/smart/sub-post-render.jade');
AlbumDialog = require('./album-dialog.ls');
userCard = require('./user-card.ls');

HERE

require("./..\\..\\..\\..\\..\\bower_components\\Sortable\\react-sortable-mixin.js")ploadFile = require('../../../common/upload-file.ls');
                                                                                    ^

Sorry my bad English. Thanks.

@nmrazvan
Copy link

This issue is still present. I encountered a similar issue where the generated code looked as follows:

require("./../../bower_components/textAngular/dist/textAngular.js")
require("./../../bower_components/textAngular/dist/textAngular-sanitize.js");
require("./../../bower_components/textAngular/dist/textAngularSetup.js")require("./../../bower_components/moment/moment.js")

... and this throws a parse error.

This seems to be caused by following piece of code from index.js:

      paths.forEach(function (p, i) {
        var st = '\nrequire(' + p + ')'
        chunks[node.range[1] + (i + 1)] = st
      })

A possible fix would be to replace the second line with:

var st = '\nrequire(' + p + ');'

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