-
Notifications
You must be signed in to change notification settings - Fork 41
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
"ReferenceError: exports is not defined" when importing a module #128
Comments
Sorry for the delay. I will have to take a closer look at this. Are you able to provide your entire webpack config file? |
Sure, by running Thank you very much for taking a look at this! |
I should add that, after inspecting the configs a bit, I tried adding the Then I tried setting Anyhow it doesn't feel "right" that the PureScript compiler is bundling stuff when that's WebPack's job. Do you have any idea about the cause of this behaviour? Thanks again for your time. |
Thanks for the info. I am wondering what version of the purs-loader, Purescript, webpack, etc., you are using. Also, is your project available on GitHub by chance? |
My
The project isn't on GitHub but I can share a ZIP file of the minimal reproduction project where I've been doing the tests reported above. I used the Vue CLI to create the project and then added the required dependencies and Webpack configuration as I described in the first post of this thread. Here is the project: I'm really wondering what could be wrong at this point... I guess there's something weird in the scaffolding that the Vue CLI did at the beginning. I tried looking around but I couldn't figure out anything useful. Thanks again for your time. |
Hi, did you happen to find anything that could be related to why this still happens? |
have same problem. purs-loader only work for naive cases. I guess better module support in purscript will solve the problem. purescript/purescript#3613 without purs-loader, If I change the all kinds of js module confuse me so much, just provide some infor I gathered. hope this is useful. |
I ran into this issue today. I tried a view things, regarding webpack configuration, and order of imports. I'm still not sure what causes this issue. Webpack Devserver and Tests are working fine, but production build lead to an output with The one thing that could lead to this issue, is that the project I'm working on is currently a mess, where Workaround: Using https://github.com/pelotom/purescript-easy-ffi to inline javascript as string. Temporary resolves the error. |
Hi, I'm trying to use purs-loader to integrate some PureScript code in my Vue project (created with the latest vue-cli).
My
vue.config.json
(which allows to modify the Webpack's configuration) looks like this:I
npm install
ed the packagespurescript
andpurs-loader
as dev-dependencies, created a bower.json file with the Purescript packages I needed for testing:and run
bower install
which completed successfully.I then created a
Test.purs
file:and imported and tested it from JS:
with everything working as expected. Then I introduced this function in the
Test.purs
file:Webpack compiled succesfully but, now, my app doesn't run anymore in the browser with the following error in the browser console:
If I click on the error hyperlink
app.js line 915 > eval:13:1
on the developer console, I can see that the error refers to line 13 of theArray.js
PureScript-transpiled file: which isI don't understand what's happening, I'm not familiar with Webpack at all... what could be wrong? Also why can I succesfully use some functions from Prelude (like the basic operators) but not other functions or functions from other modules? For instance I also can't use
show
, and clicking on the error on the console takes me to theShow.js
file with a similar line that assigns theexports
.Any help would be really appreciated,
thank you very much in advance.
The text was updated successfully, but these errors were encountered: