benmarch / angular-ui-tour

Product tour using Angular UI Bootstrap Tooltips
163 stars 49 forks source link

Incompatibility with browserify #189

Closed muliyul closed 6 years ago

muliyul commented 6 years ago

I am using the exact versions of the following:

I have installed this library via: (NPM, Bower, or downloaded package) npm

I have observed the following behavior:

Cannot find module '!!../../node_modules/css-loader/index.js!./angular-ui-tour.css' from '/Users/*/projects/*/node_modules/angular-ui-tour/dist'.

I substituted some of the path so ignore asterisks.

This is how I expected it to behave: Bundle correctly with browserify

Here is my tour config, and all related step configs: Irrelevant

Here's how I import AUIT: require('angular-ui-tour'); I've also attempted to use require('angular-ui-tour/dist/angular-ui-tour');

Additional info: By removing these lines from the dist file I was able to require the file correctly so perhaps a webpack config issue?

// file: dist/angular-ui-tour.js lines 196-207
if(false) {
    // When the styles change, update the <style> tags
    if(!content.locals) {
        module.hot.accept("!!../../node_modules/css-loader/index.js!./angular-ui-tour.css", function() {
            var newContent = require("!!../../node_modules/css-loader/index.js!./angular-ui-tour.css");
            if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
            update(newContent);
        });
    }
    // When the module is disposed, remove the <style> tags
    module.hot.dispose(function() { update(); });
}
benmarch commented 6 years ago

Hey @muliyul, sorry for the long delay. Thank you for pointing this out, I released patch 0.9.4 to fix this.