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

sourcemap(s) are causing warnings #18

Closed
sspilleman opened this issue May 13, 2016 · 9 comments
Closed

sourcemap(s) are causing warnings #18

sspilleman opened this issue May 13, 2016 · 9 comments

Comments

@sspilleman
Copy link
Contributor

workaround:

put this in webpack config file

    module: {
        preLoaders: [
            {
                test: /\.js$/,
                loader: 'source-map-loader',
                exclude: [
                    // these packages have problems with their sourcemaps
                    path.join(__dirname, 'node_modules', 'angular2-highcharts')
                ]
            }
        ],
        noParse: []
    }

list of warnings:

webpack: bundle is now INVALID.
chunk    {0} app.bundle.js, app.map (app) 1.54 MB {2} [rendered]
chunk    {1} polyfills.bundle.js, polyfills.map (polyfills) 485 kB
chunk    {2} vendor.bundle.js, vendor.map (vendor) 1.79 MB {1}

WARNING in ./~/angular2-highcharts/dist/index.js
Cannot find source file '../src/index.ts': Error: Cannot resolve 'file' or 'directory' ../src/index.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartComponent.js
Cannot find source file '../src/ChartComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartComponent.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartSeriesComponent.js
Cannot find source file '../src/ChartSeriesComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartSeriesComponent.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartPointComponent.js
Cannot find source file '../src/ChartPointComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartPointComponent.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/Highcharts.js
Cannot find source file '../src/Highcharts.ts': Error: Cannot resolve 'file' or 'directory' ../src/Highcharts.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/HighchartsService.js
Cannot find source file '../src/HighchartsService.ts': Error: Cannot resolve 'file' or 'directory' ../src/HighchartsService.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/initChart.js
Cannot find source file '../src/initChart.ts': Error: Cannot resolve 'file' or 'directory' ../src/initChart.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/createBaseOpts.js
Cannot find source file '../src/createBaseOpts.ts': Error: Cannot resolve 'file' or 'directory' ../src/createBaseOpts.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/deepAssign.js
Cannot find source file '../src/deepAssign.ts': Error: Cannot resolve 'file' or 'directory' ../src/deepAssign.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartEvent.js
Cannot find source file '../src/ChartEvent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartEvent.ts in /Volumes/Data/Dropbox/Development/Node/ng2-seed/node_modules/angular2-highcharts/dist
webpack: bundle is now VALID.
@gevgeny gevgeny closed this as completed May 13, 2016
@sspilleman
Copy link
Contributor Author

I see jou closed it.. How did you solve this? For some reason I don't see the fix?!?

@gevgeny
Copy link
Owner

gevgeny commented May 14, 2016

You didn't specify any details when created the issue first time #10. There are no steps and info about you env, bundler etc.

@sspilleman
Copy link
Contributor Author

  1. git clone https://github.com/angular/angular2-seed.git
  2. cd angular2-seed/
  3. npm install
  4. npm install angular2-highcharts --save
  5. modify files as below
  6. npm start

about.ts:

import {Component} from '@angular/core';
import {Http} from '@angular/http';
import { CHART_DIRECTIVES } from 'angular2-highcharts';

@Component({
  selector: 'about',
  templateUrl: 'app/components/about/about.html',
  styleUrls: ['app/components/about/about.css'],
  providers: [],
  directives: [CHART_DIRECTIVES],
  pipes: []
})
export class About {

  private options: Object;

  constructor(http: Http) {
    this.options = {
      title: { text: 'simple chart' },
      series: [{
        data: [29.9, 71.5, 106.4, 129.2],
      }]
    };
  }

  ngOnInit() {

  }
}

about.html

<h3>About Component</h3>
<p>This is the about component!</p>
<chart [options]="options"></chart>

warnings:

WARNING in ./~/angular2-highcharts/dist/index.js
Cannot find source file '../src/index.ts': Error: Cannot resolve 'file' or 'directory' ../src/index.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartComponent.js
Cannot find source file '../src/ChartComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartComponent.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartSeriesComponent.js
Cannot find source file '../src/ChartSeriesComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartSeriesComponent.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartPointComponent.js
Cannot find source file '../src/ChartPointComponent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartPointComponent.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/Highcharts.js
Cannot find source file '../src/Highcharts.ts': Error: Cannot resolve 'file' or 'directory' ../src/Highcharts.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/HighchartsService.js
Cannot find source file '../src/HighchartsService.ts': Error: Cannot resolve 'file' or 'directory' ../src/HighchartsService.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/initChart.js
Cannot find source file '../src/initChart.ts': Error: Cannot resolve 'file' or 'directory' ../src/initChart.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/createBaseOpts.js
Cannot find source file '../src/createBaseOpts.ts': Error: Cannot resolve 'file' or 'directory' ../src/createBaseOpts.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/deepAssign.js
Cannot find source file '../src/deepAssign.ts': Error: Cannot resolve 'file' or 'directory' ../src/deepAssign.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

WARNING in ./~/angular2-highcharts/dist/ChartEvent.js
Cannot find source file '../src/ChartEvent.ts': Error: Cannot resolve 'file' or 'directory' ../src/ChartEvent.ts in /private/tmp/angular2-seed/node_modules/angular2-highcharts/dist

@pevans360
Copy link

Note the paths in the message e.g. '../src/ChartEvent.ts'. If you look in the angular2-highcharts folder in node_modules, you'll notice 3 issues:

  1. there's no src folder ... just dist
  2. there are no xxx.ts files ... just xxx.js and xxx.d.ts
  3. the references refer to the same folder ... not one up in the tree ... so the '../' is an issue

If you go into each of the the map files and change e.g.
{"version":3,"file":"deepAssign.js","sourceRoot":"","sources":["../src/deepAssign.ts"]
to
{"version":3,"file":"deepAssign.js","sourceRoot":"","sources":["deepAssign.js"]

... the messages go away ... and it works.

@skyrocknroll
Copy link

@gevgeny We are also facing this issue. Can you please reopen it ? If you need further details i am ready help.

@gevgeny gevgeny reopened this Oct 10, 2016
@gevgeny
Copy link
Owner

gevgeny commented Oct 30, 2016

try v0.4.0

@gevgeny gevgeny closed this as completed Oct 30, 2016
@wouterter
Copy link

The problem still exists in 0.4.1 with the Webpack starter. I get a lot of these warnings, for example:

Cannot find source file '../src/ChartXAxisComponent.ts': Error: Can't resolve '../src/ChartXAxisComponent.ts'.

@tsabran
Copy link

tsabran commented Nov 23, 2016

I also still have the issue with v0.4.1, which I can fix by manually applying the patch from pevans306 / Raymice on my node_modules/angular2-highcharts/dist.

So I guess PR #100 is still applicable.

@tsabran
Copy link

tsabran commented Nov 23, 2016

Actually the PR #100 is changing the map files in dist directory, that are regenerated at build time, so I guess it's not an option.

I don't understand how the map files are generated, but if they are referencing the .ts files in ../src/ directory, maybe the simpler would be to ship the src folder in the npm package, so that the map files can be valid.
@gevgeny what do you think of this option ?

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

6 participants