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

canvas is not defined #218

Open
Madhivarman opened this issue Jun 25, 2017 · 1 comment
Open

canvas is not defined #218

Madhivarman opened this issue Jun 25, 2017 · 1 comment

Comments

@Madhivarman
Copy link

I am trying to integrate CamanJs with the application but when i tried to run the error it shows canvas is not defined

i installed canvas using

npm install canvas

i included 'canvas' in externals in webpack.config.js still there is a error

externals : [ 'canvas' ],

error it shows

@http://localhost:8100/build/main.js:115815:1
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:74369:14
@http://localhost:8100/build/main.js:74198:1
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:74163:64
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:115776:75
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:105867:73
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:78067:70
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:63:18
@http://localhost:8100/build/main.js:1:1

my Ionic Information

global packages:

I am trying to integrate CamanJs with the application but when i tried to run the error it shows canvas is not defined

i installed canvas using

npm install canvas

i included 'canvas' in externals in webpack.config.js still there is a error

externals : [ 'canvas' ],

error it shows

@http://localhost:8100/build/main.js:115815:1
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:74369:14
@http://localhost:8100/build/main.js:74198:1
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:74163:64
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:115776:75
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:105867:73
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:78067:70
webpack_require@http://localhost:8100/build/main.js:20:12
@http://localhost:8100/build/main.js:63:18
@http://localhost:8100/build/main.js:1:1

my Ionic Information

global packages:

@ionic/cli-utils : 1.4.0
Ionic CLI : 3.4.0

local packages:

@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework : ionic-angular 3.4.2

System:

Node : v8.0.0
OS : Linux 4.6
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 5.0.3

AnySolution for this..ThankYou..

@sSeewald
Copy link

You can simply set 'export' to undefined and inject the window context with the imports-loader.

import 'imports-loader?exports=>undefined,require=>false,this=>window!caman-dist-only';

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