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

webpack fails to compile with ActionText #36368

Closed
willnet opened this issue May 31, 2019 · 12 comments
Closed

webpack fails to compile with ActionText #36368

willnet opened this issue May 31, 2019 · 12 comments

Comments

@willnet
Copy link
Contributor

willnet commented May 31, 2019

Steps to reproduce

rails new sampleapp
cd sampleapp
./bin/rails action_text:install
./bin/webpack 

Expected behavior

webpack compile without errors

Actual behavior

Hash: a8bf5b9bd28ddb3deacf
Version: webpack 4.32.2
Time: 3186ms
Built at: 2019/05/31 14:33:31
                                     Asset       Size       Chunks             Chunk Names
    js/application-498850090c9b38b11a80.js    870 KiB  application  [emitted]  application
js/application-498850090c9b38b11a80.js.map    771 KiB  application  [emitted]  application
                             manifest.json  364 bytes               [emitted]  
Entrypoint application = js/application-498850090c9b38b11a80.js js/application-498850090c9b38b11a80.js.map
[./app/javascript/channels sync recursive _channel\.js$] ./app/javascript/channels sync _channel\.js$ 160 bytes {application} [built]
[./app/javascript/channels/index.js] 487 bytes {application} [built]
[./app/javascript/packs/application.js] 799 bytes {application} [built]
[./node_modules/webpack/buildin/amd-options.js] (webpack)/buildin/amd-options.js 80 bytes {application} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 1.01 KiB {application} [built]
[./node_modules/webpack/buildin/harmony-module.js] (webpack)/buildin/harmony-module.js 822 bytes {application} [built]
    + 302 hidden modules

ERROR in ./node_modules/@rails/actiontext/app/javascript/actiontext/attachment_upload.js 19:28-40
"export 'DirectUpload' was not found in '@rails/activestorage'
 @ ./node_modules/@rails/actiontext/app/javascript/actiontext/index.js
 @ ./app/javascript/packs/application.js

System configuration

Rails version:
6.0.0.rc1
Ruby version:
2.6.3

@abhaynikam
Copy link
Contributor

abhaynikam commented May 31, 2019

I can reproduce this issue on Rails 6.0.0.rc1 but not on the master branch.

@y-yagi
Copy link
Member

y-yagi commented May 31, 2019

Maybe related to rails/webpacker#2109 (comment), rails/webpacker#2111.

@jakeNiemiec
Copy link
Member

jakeNiemiec commented May 31, 2019

Related issue: #36278 (comment)

This should be fixed with @rails/webpacker@4.0.6.

@abhaynikam
Copy link
Contributor

This should be fixed with @rails/webpacker@4.0.6

@jakeNiemiec : I tried creating an app with Rails 6.0.0.rc1 and @rails/webpacker@4.0.6. It still fails with the same error.

here is the gist of files you had asked in the comment -> https://gist.github.com/abhaynikam/62f9c4b32ebe81fb01052c59dca63ea4

@jakeNiemiec
Copy link
Member

jakeNiemiec commented May 31, 2019

Did you run rails action_text:install? Also, can you post the exact error to the gist? I am unable to get an error with the same files.

@jernestosuarez
Copy link

Same error here with 6.0.0.rc1 and webpacker 4.0.6 after rails action_text:install in a fresh app.

@0x2C6
Copy link

0x2C6 commented Jun 3, 2019

Same here

@jakeNiemiec
Copy link
Member

@jernestosuarez @0x2C6 @abhaynikam Can you tell me if changing line 61 in your babel.config.js file fixes it?

      [
        require('@babel/plugin-transform-runtime').default,
        {
          helpers: false,
          regenerator: true,
-         corejs: 3
+         corejs: false
        }
      ],

If not, can you post a gist like this: #36368 (comment) (👆4 comments up)

@abhaynikam
Copy link
Contributor

@jakeNiemiec : With the change suggested in the babel.config.js in the above comment(#36368 (comment)).

Webpack compile worked for me. 👍

@jernestosuarez
Copy link

@jakeNiemiec : works for me too.

@atstockland
Copy link

corejs: false Fixed me up too

@jakeNiemiec
Copy link
Member

jakeNiemiec commented Jun 3, 2019

Glad to hear it. PR to fix for everyone: rails/webpacker#2116

See rails/webpacker#2109 (comment) for further instructions.

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

7 participants