0

Used create-react-app. added the client and socketio-client.

dev server runs fine.

go to build :

Failed to minify the code from this file:

    ./node_modules/@feathersjs/socketio-client/lib/index.js:10

thought I must've messed something up. so download the basic feathers chat react client example. dev server runs fine. go to build :

static/js/main.b9a07b83.js from UglifyJs SyntaxError: Unexpected token punc «,», expected punc «:» [./~/@feathersjs/commons/lib/commons.js:6,49]

error Command failed with exit code 1.

I thought the client js files in the feathers library were written to be ES5 browser compatible/buildable w/ create-react-app. but for some reason, during build they are throwing these errors.

I have no clue how to fix this without having to eject webpack config (from react-scripts) include es2015 preloader.

Is there an easier way? I must have something configured incorrectly, bc the basic feathers/react chat example isn't even building...

Reproduce:

nacmonad
  • 41
  • 1
  • 6
  • workaround: add library cdn to index.html, remove from build packages in react app: const socket = io(CONNECTION_URL); const client = window.feathers().configure(window.feathers.socketio(socket)); – nacmonad Apr 14 '18 at 19:01

1 Answers1

0

It was a mistake in the example application. As documented in the usage with create-react-app anything that needs a pre-transpiled version should use @feathersjs/client.

It is now fixed in the feathersjs-ecosystem/feathers-chat-react repository (with this commit).

Daff
  • 43,734
  • 9
  • 106
  • 120