ardatan / meteor-webpack

https://medium.com/@ardatan/meteor-with-webpack-in-2018-faster-compilation-better-source-handling-benefit-from-bc5ccc5735ef
MIT License
123 stars 29 forks source link

Problem with some libraries and @babel/runtime #6

Closed filipenevola closed 6 years ago

filipenevola commented 6 years ago

Hello, I'm trying to run a small/medium size app and for that I need to start to use .jsx files (I was using only .js files) and I had to only use relative imports (I was using /imports sometimes) but even with these changes I'm not able to run my project yet.

I'm having errors with material ui icons and react tunnels, I think webpack is not loading those, the icons can be because of svg extension but react tunnels I have no idea.

from material-ui-icons

ERROR in ./imports/core/person/personStatuses.jsx
Module parse failed: Unexpected token (6:17)
You may need an appropriate loader to handle this file type.
| import { default as SentimentSatisfied } from 'material-ui-icons/SentimentSatisfied';
| 
| const goodIcon = <SentimentSatisfied className="person-good" />;
| const neutralIcon = <SentimentNeutral className="person-neutral" />;
| const badIcon = <SentimentDissatisfied className="person-bad" />;
 @ ./imports/core/systematic/systematic.js 19:0-62 159:12-26
 @ ./imports/collections/PeopleCollection.js
 @ ./imports/resolvers.js
 @ ./server/main.js
 @ multi ./server/main.js

from tunnel:

ERROR in ./imports/ui/components/uis.jsx
Module parse failed: Unexpected token (38:9)
You may need an appropriate loader to handle this file type.
|     document.title = title ? `${title} | bemarke` : 'bemarke';
|   }
|   return <Tunnel id="app-title">{title || 'bemarke'}</Tunnel>;
| };
| 
 @ ./imports/core/scheduleOptions.js 3:0-79 124:7-42
 @ ./imports/collections/ActivitiesCollection.js
 @ ./imports/resolvers.js
 @ ./server/main.js
 @ multi ./server/main.js

I'm also having this error:

W20180329-15:52:29.677(-3)? (STDERR) /home/filipe/Documents/quave/ws/bemarke/.meteor/local/build/programs/server/boot.js:475
W20180329-15:52:29.678(-3)? (STDERR) }).run();
W20180329-15:52:29.678(-3)? (STDERR)    ^
W20180329-15:52:29.678(-3)? (STDERR) 
W20180329-15:52:29.678(-3)? (STDERR) Error: Cannot find module '@babel/runtime/helpers/builtin/objectSpread'
W20180329-15:52:29.678(-3)? (STDERR)     at Function.Module._resolveFilename (module.js:538:15)
W20180329-15:52:29.679(-3)? (STDERR)     at Function.resolve (internal/module.js:18:19)
W20180329-15:52:29.679(-3)? (STDERR)     at Object.require (/home/filipe/Documents/quave/ws/bemarke/.meteor/local/build/programs/server/boot.js:288:32)
W20180329-15:52:29.679(-3)? (STDERR)     at makeInstallerOptions.fallback (packages/modules-runtime.js:651:18)
W20180329-15:52:29.679(-3)? (STDERR)     at require (packages/modules-runtime.js:244:16)
W20180329-15:52:29.679(-3)? (STDERR)     at livedata_connection.js (/home/filipe/Documents/quave/ws/bemarke/.meteor/local/build/programs/server/packages/ddp-client.js:149:45)
W20180329-15:52:29.679(-3)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
W20180329-15:52:29.680(-3)? (STDERR)     at require (packages/modules-runtime.js:238:16)
W20180329-15:52:29.680(-3)? (STDERR)     at namespace.js (packages/ddp-client/common/namespace.js:1:300)
W20180329-15:52:29.680(-3)? (STDERR)     at fileEvaluate (packages/modules-runtime.js:343:9)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.

Do you know why? Any thing that I can do to improve it? I think in this case the problem is with Webpack and not with your package but maybe you can help me :smile:

ardatan commented 6 years ago

Are you sure you have installed @babel/runtime in your project? I’ll try to reproduce your problem when I got home.

filipenevola commented 6 years ago

Hello, yes, I'm sure!

Any news? Do you need help?

ardatan commented 6 years ago

Hello, sorry for my late response. I couldn't reproduce these errors. But I found something for @babel/runtime stuff. https://forums.meteor.com/t/meteor-fails-to-start-after-update/42832

filipenevola commented 6 years ago

Hello, I was able to get rid of the babel/runtime error updating to the latest but I'm not able to make the files with react be load properly and with rest operator too, looks like the webpack config + babel config is not being fully loaded.

I saw that in your react example you are using older versions of some dependencies, like "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1",

maybe will be good to update this example to be up-to-date with every lib and see if everything still works.

ardatan commented 6 years ago

I am not very good at React bunding, so the example may be a little old ( I cloned Meteor's official example : ) ) I will try to reproduce that issue.

ardatan commented 6 years ago

Do you have any update on this issue?