tinymce / tinymce-react

Offical TinyMCE React component
MIT License
959 stars 156 forks source link

Hosting the TinyMCE package with the React framework not working in production #387

Closed sgidd closed 1 year ago

sgidd commented 2 years ago

I have implemented tinymce using package manager with hosting which works fine in my localhost but when it is deployed in production build AWS its failing with below error :

image

I have followed the step as suggested in https://www.tiny.cloud/docs/tinymce/6/react-pm-host/

image

image

package.json file :

"scripts": { "prebuild": "npm run tinymce-postinstall", "build": "webpack --mode production --env BASE_URL=/api", "predev": "npm run tinymce-postinstall", "dev": "npm run webpack-dev", }

any assist on this will be great help .

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-3022

tiny-james commented 1 year ago

According to the error message the file is being served as HTML instead of Javascript. I think you have some settings wrong on AWS.

This stackoverflow question seems related to your problem so maybe try one of those solutions: https://stackoverflow.com/questions/67925203/aws-cloudfront-serving-javascript-modules-as-wrong-mime-type-text-plain