Skip to content

Can't resolve 'crossfilter' in '~node_modules\dc' #6354

Closed
@alexkibler

Description

@alexkibler

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.3
node: 6.10.3
os: win32 x64
@angular/common: 4.1.2
@angular/compiler: 4.1.2
@angular/core: 4.1.2
@angular/forms: 4.1.2
@angular/http: 4.1.2
@angular/platform-browser: 4.1.2
@angular/platform-browser-dynamic: 4.1.2
@angular/router: 4.1.2
@angular/cli: 1.0.3
@angular/compiler-cli: 4.1.2

Repro steps.

ng new testproj && cd testproj
npm install --save dc

replace app.component.ts with

import { Component } from '@angular/core';
import * as crossfilter from 'crossfilter2';
import * as d3 from 'd3';
import * as dc from 'dc';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app works!';

    constructor() {
        this.setupCharts();
    }
  
    setupCharts() {
        const chart = dc.barChart('#test');
        chart.width(768);
    }
}

The log given by the failure.

ERROR in ./~/dc/dc.js
Module not found: Error: Can't resolve 'crossfilter' in 'C:\Users\akibler\Documents\Visual Studio 2017\Projects\testproj\node_modules\dc'
 @ ./~/dc/dc.js 10707:8-42
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

Desired functionality.

Let me use DC?

Mention any other details that might be useful.

This issue with dc.js makes it seem like we need to be able to add a "resolve" to the webpack config. I'm not sure that this is possible with .angular-cli.json

Metadata

Metadata

Assignees

Labels

needs: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions