cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

Uncaught ReferenceError: cornerstone is not defined

Open rangata opened this issue 8 years ago • 2 comments

Dear Friends,

I'm trying to reference cornerstone in my laravel project(5.6), but I've got this error" Uncaught ReferenceError: cornerstone is not defined.

Here is my webpack file:

let mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('node_modules/jquery/dist/jquery.js', 'public/js');

// mix.js('resources/assets/js/app.js', 'public/js')
//    .sass('resources/assets/sass/app.scss', 'public/css');

mix.js('node_modules/datatables/media/js/jquery.dataTables.js', 'public/js/datatable.js');
mix.js('node_modules/cornerstone-core/dist/cornerstone.js', 'public/js');
mix.js('node_modules/cornerstone-tools/dist/cornerstoneTools.js', 'public/js');
mix.js('node_modules/jquery/dist/jquery.slim.js', 'public/js');

I also try to include it from CDN, but it's the same.

What's wrong with my code?

Thank you!

rangata avatar Mar 08 '18 04:03 rangata

You shouldn't need to include anything cornerstone specific in a WebPack config?

See the NPM sections under:

For a full "Getting Started" example using the CDN, you can check out this

dannyrb avatar Mar 08 '18 13:03 dannyrb

It's possible this issue is the fact that you need to provide the cornerstone instance to cornerstoneTools

cornerstoneTools.external.cornerstone = cornerstone

swederik avatar Apr 06 '18 10:04 swederik