Closed bebraw closed 8 years ago
Hi, after setting the above configuration I am now getting the following error during the webpack build,
ERROR in ./src/test/upload-file.jsx Module not found: Error: Cannot resolve module 'exports' in /home/hbashar/Projects/DOX/server/src/brainloop/doxweb/client/src/test @ ./src/test/upload-file.jsx 23:0-16
can you please tell me why I am getting this error/
@hosain-cse2 Can you provide more information? Which module are you trying to use in your project?
That error is gone now. I was missing the "exports-loader" module. After installing it with my project it is working now. But I am getting another error now. The page I was trying to introduce the plupload I import is as following,
require('moxie-plupload');
and when I an loading the page in the browser in the console i am getting the following errors,
in Chrome: Uncaught TypeError: Cannot read property 'moxie' of undefined
im FireFox: TypeError: target is undefined ...i=0; fi < fragments.length - 1; ++fi) {if(target[fragments[fi]] === undefined){t...
Can you tell me why I am getting this error? Do I have to import it in another way in my page?
It's very hard for me to say. Can you set up a minimal demo project to study?
@hosain-cse2 - Since i saw plupload was being exported to the window object - I got this working by following the sample config at the top and adding this to my file:
import plupload from 'moxie-plupload';
//-- Plupload is available!
console.log(window.plupload);
I too am getting the Uncaught TypeError: Cannot read property 'moxie' of undefined issue, i have followed the example config above but can't get past this.
I think this is related just to the moxie.js script because if i just try to require('moxie') on my page script without require('moxie-plupload') i still get the exact same error.
Did anybody got this to work in the end with webpack?
thank you, i successed! because moxie-plupload exports is a window object, so your must add the code require("moxie-plupload") in your main page, and in other page your use plupload object direct, Enlish not good , heihei
Just to quote @jeffijoe at Gitter (sample conf):
Loaders:
Alias:
ProvidePlugin: