I have installed tinymce in my EmberJS application. When I run npm start or even npm run build, I get an error like so:
[Package /assets/vendor.js]/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:98681
throw e;
Error: Debug Failure.
at Object.assertDefined (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:2227:24)
at /home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39474:34
at Object.filter (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:513:31)
at serializeAsClass (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39472:48)
at serializeSymbolWorker (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39203:29)
at serializeSymbol (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39144:38)
at /home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39119:25
at Map.forEach (<anonymous>)
at visitSymbolTable (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:39118:33)
at symbolTableToDeclarationStatements (/home/ikirkpat/Projects/proj_name/frontend/node_modules/typescript/lib/typescript.js:38989:17)
⠧ building... [SassCompiler](node:14526) UnhandledPromiseRejectionWarning: Error: Debug Failure.
at CommandCoordinator.dispatchResponse (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:54:69)
at CommandCoordinator.<anonymous> (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:43:29)
at Generator.next (<anonymous>)
at /home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:3:12)
at CommandCoordinator.messageReceived (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:40:16)
at ChildProcess.emit (events.js:311:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
(node:14526) UnhandledPromiseRejectionWarning: Error: Debug Failure.
at CommandCoordinator.dispatchResponse (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:54:69)
at CommandCoordinator.<anonymous> (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:43:29)
at Generator.next (<anonymous>)
at /home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:3:12)
at CommandCoordinator.messageReceived (/home/ikirkpat/Projects/proj_name/frontend/node_modules/stagehand/lib/command-coordinator.js:40:16)
at ChildProcess.emit (events.js:311:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
(node:14526) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 15)
For background, this was building perfectly before. Then I merged my teams master branch into my feature branch to fix merge conflicts and now it won't build.
So here is my package.json:
{
"name": "...",
"version": "0.0.0",
"private": true,
"description": "...",
"repository": "",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"codegen": "graphql-codegen",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve --ssl --secure-proxy false --proxy https://localhost:5001 --environment local",
"test": "ember test"
},
"devDependencies": {
"#ember/edition-utils": "^1.1.1",
"#ember/jquery": "^1.1.0",
"#ember/optional-features": "^1.1.0",
"#glimmer/component": "^1.0.0",
"#types/ember": "^3.1.1",
"#types/ember-qunit": "^3.4.7",
"#types/ember__test-helpers": "^0.7.9",
"#types/qunit": "^2.9.0",
"#types/rsvp": "^4.0.3",
"apollo-link-error": "^1.1.12",
"babel-eslint": "^10.0.2",
"broccoli-asset-rev": "^3.0.0",
"ember-animated": "^0.9.0",
"ember-apollo-client": "2.0.0",
"ember-auto-import": "^1.5.3",
"ember-cli": "~3.15.1",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.13.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-build": "^2.0.0",
"ember-cli-deploy-s3": "^1.4.0",
"ember-cli-htmlbars": "^4.2.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-sass": "^10.0.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-typescript": "^3.1.1",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-cli-uglify": "^3.0.0",
"ember-cli-update": "^0.49.6",
"ember-css-modules": "^1.3.0-beta.1",
"ember-css-modules-sass": "^1.0.1",
"ember-drag-drop": "atomicobject/ember-drag-drop#feature/horizontal-sorting-improvements",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^7.0.0",
"ember-intl": "^4.2.2",
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-paper": "^1.0.0-beta.26",
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-source": "https://s3.amazonaws.com/builds.emberjs.com/beta/shas/49ae818907447d9c469d68b297060f00728ffb5a.tgz",
"ember-template-lint": "^1.5.0",
"ember-test-selectors": "^2.1.0",
"ember-tooltips": "^3.4.2",
"ember-welcome-page": "^4.0.0",
"ember-wormhole": "^0.5.5",
"eslint": "^6.1.0",
"eslint-plugin-ember": "^7.7.1",
"eslint-plugin-node": "^10.0.0",
"graphql": "^14.5.8",
"liquid-fire": "^0.31.0",
"loader.js": "^4.7.0",
"qunit-dom": "^0.9.2",
"sass": "^1.23.3",
"typescript": "^3.7.2"
},
"engines": {
"node": "8.* || >= 10.*"
},
"ember": {
"edition": "octane"
},
"dependencies": {
"#ember/render-modifiers": "^1.0.2",
"#glimmer/tracking": "^0.14.0-alpha.1",
"#graphql-codegen/cli": "^1.9.1",
"#graphql-codegen/near-operation-file-preset": "^1.9.1",
"#graphql-codegen/typescript": "^1.9.1",
"#graphql-codegen/typescript-compatibility": "^1.9.1",
"#graphql-codegen/typescript-operations": "^1.9.1",
"#simple-dom/interface": "^1.4.0",
"#types/faker": "^4.1.8",
"#types/lodash-es": "^4.17.3",
"#types/tinymce": "^4.5.24",
"apollo-cache-inmemory": "^1.6.3",
"apollo-link": "^1.2.13",
"apollo-link-batch-http": "^1.2.13",
"bufferutil": "^4.0.1",
"cldr-core": "^36.0.0",
"ember-click-outside": "^1.3.0",
"ember-concurrency-decorators": "^1.0.0",
"ember-file-upload": "^2.7.1",
"ember-hacky-set-value": "0.0.1",
"es6-promise": "^4.2.8",
"faker": "^4.1.0",
"isomorphic-fetch": "^2.2.1",
"lodash-es": "^4.17.15",
"moment": "^2.24.0",
"tinymce": "^5.2.1"
}
}
It was builing until the ember-hacky-set-value package was introduced so I wonder if that's the problem. But that seems like a completely unrelated change that shouldn't have effected tinymce. So maybe it's something else?
You just need to change line "typescript": "^3.7.2" -> "typescript": "~3.7.2"
Somehow your typescript got updated to 3.8, which has this issue: https://github.com/typed-ember/ember-cli-typescript/issues/1103
Related
I'm trying to use Node and React together and I'm having a terrible time getting them to play nicely. Any guidance in pointing out what I'm doing wrong would be hugely helpful.
As a precursor, I've already reviewed this question and tried everything I can based on the answers there, but no luck.
Setup
I'm currently running Node version 16.15.1
I've installed React via the instructions found here
Attempt 1
Straight out of the gate, I get this error: Uncaught SyntaxError: Cannot use import statement outside a module (at index.js:1:1)
index.js is a standard React file. Line 1 starts like this: import React from 'react';
Attempt 2
One of the answers was to add "type": "module" to the package.json file, but that produced this error: ReferenceError: require is not defined in ES module scope, you can use import instead This file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\path\to\app\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
The lift for me here makes this impractical. I'm using a Node template that has a ton of stuff baked in already...dozens of files, and probably hundreds of 'require' statements. And many the files that were 'required' would need modification to export everything in the right format. It's just...a lot.
Attempt 3
So then I tried to add the module type to the script tag itself, i.e. <script type="module" src="blah">. This produced the following error: Uncaught SyntaxError: Unexpected token '<' (at index.js:9:3).
Attempt 4
Finally, I tried changing the React file from index.js to index.mjs which produced this error: Uncaught SyntaxError: Cannot use import statement outside a module (at index.mjs:1:1).
I've also tried combining the .mjs file extension with adding the type="module" to the script tag with no luck. Any help would be very much appreciated!
index.js
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint.
reportWebVitals();
Additional Context
I've started with meanjs.org as the template, but it's several years out of date. I've made updates to get the server running, and have scrubbed Angular out of the public directory, where I installed React in. I can run React by itself without issues, but when I try to add a root element in my node app and include React's index.js file, it most definitely imports the file and that's where it chokes.
Here's my package.json file:
{
"name": "test",
"description": "Test app",
"version": "0.1.0",
"private": false,
"author": "Test",
"license": "MIT",
"repository": {
"type": "git",
"url": ""
},
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"scripts": {
"update": "npm update && npm prune",
"clean": "rm -rf node_modules/ public/lib/",
"reinstall": "npm cache clean && npm run clean && npm install",
"start": "gulp",
"start:prod": "gulp prod",
"start:debug": "node-debug --web-host 0.0.0.0 server.js & gulp debug",
"gulp": "gulp",
"lint": "gulp lint",
"test": "gulp test",
"test:server": "gulp test:server",
"test:server:watch": "gulp test:server:watch",
"test:client": "gulp test:client",
"test:e2e": "gulp test:e2e",
"test:coverage": "gulp test:coverage",
"generate-ssl-certs": "scripts/generate-ssl-certs.sh",
"seed": "gulp seed",
"seed:prod": "gulp seed:prod",
"seed:test": "gulp seed:test",
"snyk-protect": "snyk protect",
"prepare": "npm run snyk-protect"
},
"dependencies": {
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.3.0",
"#testing-library/user-event": "^13.5.0",
"acl": "^0.4.11",
"amazon-s3-uri": "0.0.3",
"async": "~2.5.0",
"aws-sdk": "^2.548.0",
"body-parser": "^1.19.0",
"chalk": "~2.1.0",
"compression": "^1.7.4",
"connect-flash": "~0.1.1",
"connect-mongo": "^4.6.0",
"cookie-parser": "^1.4.4",
"del": "~3.0.0",
"eslint-config-airbnb": "~6.0.2",
"express": "^4.17.1",
"express-hbs": "^1.0.5",
"express-session": "^1.17.0",
"generate-password": "~1.3.0",
"glob": "^7.1.4",
"gulp": "^4.0.2",
"gulp-angular-templatecache": "~2.0.0",
"gulp-autoprefixer": "~4.0.0",
"gulp-concat": "~2.6.1",
"gulp-csslint": "^1.0.1",
"gulp-csso": "^3.0.1",
"gulp-eslint": "^4.0.0",
"gulp-imagemin": "~5.0.0",
"gulp-less": "^4.0.0",
"gulp-load-plugins": "~1.5.0",
"gulp-ng-annotate": "~2.0.0",
"gulp-nodemon": "^2.4.1",
"gulp-refresh": "^1.1.0",
"gulp-rename": "^1.2.3",
"gulp-rev": "~8.0.0",
"gulp-sass": "^5.1.0",
"gulp-uglify": "^3.0.2",
"helmet": "^3.21.1",
"imagemin-pngquant": "~6.0.0",
"jasmine-core": "~3.0.0",
"lodash": "^4.17.15",
"lusca": "^1.5.2",
"method-override": "^2.3.10",
"mongoose": "^6.4.0",
"morgan": "^1.9.1",
"multer": "^1.3.1",
"multer-s3": "^2.9.0",
"node-sass": "^6.0.0",
"nodemailer": "~4.0.1",
"owasp-password-strength-test": "~1.3.0",
"passport": "~0.3.2",
"passport-facebook": "~2.1.1",
"passport-github": "~1.1.0",
"passport-google-oauth": "~1.0.0",
"passport-linkedin": "~1.0.0",
"passport-local": "~1.0.0",
"passport-paypal-openidconnect": "^0.1.1",
"passport-twitter": "~1.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"run-sequence": "~2.1.0",
"sass": "^1.53.0",
"serve-favicon": "^2.5.0",
"snyk": "^1.234.2",
"socket.io": "^2.3.0",
"validator": "~9.4.1",
"web-vitals": "^2.1.4",
"winston": "~2.3.1",
"wiredep": "~4.0.0"
},
"devDependencies": {
"coveralls": "^2.13.3",
"gulp-istanbul": "^1.1.3",
"gulp-mocha": "~3.0.1",
"gulp-protractor": "~4.1.0",
"karma": "6.4.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage": "^1.1.2",
"karma-jasmine": "^1.1.2",
"karma-mocha-reporter": "^2.2.5",
"karma-ng-html2js-preprocessor": "~1.0.0",
"semver": "~5.4.1",
"should": "~11.2.1",
"supertest": "~3.0.0"
},
"snyk": true,
"proxy": "http://localhost:3000"
}
The package.json file from React is unchanged from the original install.
Final note: I'm a self-taught developer. Please be gentle. :)
I just upgraded the expo SDK in my react native app from 42 to 43 using "expo upgrade 43" and I've been getting an error that says:
AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '#react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage
at node_modules/react-native/Libraries/Utilities/warnOnce.js:27:2 in warnOnce
at node_modules/react-native/index.js:300:12 in module.exports.get__AsyncStorage
at node_modules/#firebase/app/dist/index.rn.cjs.js:615:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/#firebase/firestore/dist/rn/index.js:1:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/firebase/firestore/dist/index.node.cjs.js:3:7 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at App.js:1:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/expo/AppEntry.js:3:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
at http://192.168.100.149:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:624639:3 in global code
TypeError: (0, _expoModulesCore.requireNativeModule) is not a function. (In '(0, _expoModulesCore.requireNativeModule)('ExpoCrypto')', '(0, _expoModulesCore.requireNativeModule)' is undefined)
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/#react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
at http://192.168.100.149:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:624639:3 in global code
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/#react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
I don't know what is actually causing the error. Whether it's expo-modules-core or AsyncStorage. I have searched for solutions online where some suggested that I delete the node_modules folder and package-lock.json and reinstall all the packages again but still getting the same errors.
My project environment:
node v16.15.1
yarn v1.22.19
expo-cli v5.4.6
Expo Go latest version
My package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"start:sandbox": "MY_ENVIRONMENT=sandbox expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"storybook": "start-storybook -p 7007",
"build-storybook": "build-storybook",
"prestorybook": "rnstl",
"lint": "eslint --fix .",
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md}' --config ./.prettierrc",
"test:android": "cavy run-android --skipbuild",
"build:sandbox:android": "MY_ENVIRONMENT=sandbox expo build:android --release-channel sandbox",
"build:sandbox:ios": "MY_ENVIRONMENT=sandbox expo build:ios --release-channel sandbox",
"publish:sandbox": "MY_ENVIRONMENT=sandbox expo publish --release-channel sandbox",
"build:prod:android": "expo build:android --release-channel v1.1.5",
"build:prod:ios": "expo build:ios --release-channel v1.1.5",
"publish:prod": "expo publish --release-channel v1.1.5"
},
"dependencies": {
"#eva-design/eva": "^2.0.0",
"#expo-google-fonts/signika": "^0.1.0",
"#expo/vector-icons": "^12.0.0",
"#expo/webpack-config": "^0.16.2",
"#gorhom/bottom-sheet": "3.6.5",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/checkbox": "^0.5.7",
"#react-native-community/datetimepicker": "3.5.2",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/picker": "^1.8.1",
"#react-native-community/segmented-control": "2.2.1",
"#react-native-community/viewpager": "5.0.11",
"#react-navigation/bottom-tabs": "^5.11.2",
"#react-navigation/material-top-tabs": "^5.3.13",
"#react-navigation/native": "^5.8.10",
"#react-navigation/stack": "^5.12.8",
"date-fns": "^2.16.1",
"expo": "^43.0.0",
"expo-app-loading": "~1.2.1",
"expo-asset": "~8.4.3",
"expo-camera": "~12.0.3",
"expo-cellular": "~4.0.0",
"expo-constants": "~12.1.3",
"expo-device": "~4.0.3",
"expo-facebook": "~12.0.3",
"expo-firebase-analytics": "~5.0.3",
"expo-firebase-core": "~4.0.3",
"expo-firebase-recaptcha": "~2.0.2",
"expo-firestore-offline-persistence": "^0.1.0",
"expo-font": "~10.0.3",
"expo-image-manipulator": "~10.1.2",
"expo-image-picker": "~11.0.3",
"expo-linking": "~2.4.2",
"expo-media-library": "~13.0.3",
"expo-network": "~4.0.3",
"expo-notifications": "~0.13.3",
"expo-permissions": "~13.0.3",
"expo-screen-orientation": "~4.0.3",
"expo-secure-store": "~11.0.3",
"expo-splash-screen": "~0.13.5",
"expo-sqlite": "~10.0.3",
"expo-status-bar": "~1.1.0",
"expo-store-review": "~5.0.3",
"expo-task-manager": "~10.0.3",
"expo-tracking-transparency": "~2.0.3",
"expo-updates": "~0.10.15",
"expo-web-browser": "~10.0.3",
"firebase": "8.2.3",
"formik": "^2.2.6",
"indexeddbshim": "6.6.0",
"lodash": "^4.17.20",
"p-iteration": "^1.1.8",
"prop-types": "^15.7.2",
"qs": "^6.9.6",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-hot-toast": "^1.0.2",
"react-native": "0.64.3",
"react-native-background-actions": "^2.6.7",
"react-native-calendars": "^1.1129.0",
"react-native-expo-cached-image": "^1.3.1",
"react-native-gesture-handler": "~1.10.2",
"react-native-gifted-chat": "^0.16.3",
"react-native-google-places-autocomplete": "^2.1.2",
"react-native-image-gallery": "^2.1.5",
"react-native-keyboard-avoiding-scroll-view": "^1.0.1",
"react-native-modal-datetime-picker": "^9.1.0",
"react-native-modal-dropdown": "https://github.com/siemiatj/react-native-modal-dropdown",
"react-native-onboarding-swiper": "^1.1.4",
"react-native-phone-number-input": "^2.0.0",
"react-native-ratings": "^7.4.0",
"react-native-reanimated": "~2.2.0",
"react-native-redash": "^16.0.11",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-search-filter": "^0.1.5",
"react-native-svg": "12.1.1",
"react-native-tab-view": "^2.15.2",
"react-native-tailwindcss": "^1.1.11",
"react-native-url-polyfill": "^1.2.0",
"react-native-web": "0.17.1",
"react-native-webview": "11.13.0",
"react-native-woodpicker": "^0.2.8",
"react-redux": "^7.2.2",
"react-redux-firebase": "^3.10.0",
"redux": "^4.0.5",
"redux-firestore": "https://bitbucket.org/handytradiegh/redux-firestore",
"redux-persist": "^6.0.0",
"rxjs": "^6.6.6",
"sentry-expo": "^4.0.0",
"yup": "^0.32.8"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"#babel/plugin-syntax-class-properties": "^7.12.13",
"#babel/plugin-transform-react-jsx-source": "^7.12.1",
"#storybook/addon-actions": "^5.3",
"#storybook/addon-knobs": "^5.3",
"#storybook/addon-links": "^5.3",
"#storybook/addon-ondevice-actions": "^5.3.23",
"#storybook/addon-ondevice-knobs": "^5.3.23",
"#storybook/react-native": "^5.3.23",
"#storybook/react-native-server": "^5.3.23",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-module-resolver": "^4.1.0",
"cavy": "^4.0.1",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.10.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"prettier": "^2.2.1",
"prettier-plugin-organize-imports": "^1.1.1",
"react-native-storybook-loader": "^2.0.2",
"typescript": "~4.3.5"
},
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element|#react-native-community|expo(nent)?|#expo(nent)?/.*|react-navigation|#react-navigation/.*|#unimodules/.*|unimodules|sentry-expo|native-base)"
],
"setupFilesAfterEnv": [
"<rootDir>/__mocks__/globalMock.js"
]
},
"config": {
"react-native-storybook-loader": {
"searchDir": [
"./src"
],
"pattern": "**/*.stories.js",
"outputFile": "./storybook/storyLoader.js"
}
},
"private": true,
"resolutions": {
"#react-native-community/picker": "^1.8.1"
}
}
Please help me out!!!
Delete your node modules, yarn.lock and package-lock.json, and run
npm install
After cloning the repository from Github then install npm and try to execute ember s. but I got this error. Then I delete node modules directory and package-lock.json file and install npm again. But i can't solve it.I am googling this error but can't solve it. Plz, Help me.
Here is my Error:
Build Error (broccoli-persistent-filter:EslintValidationFilter) in helpers/flash-
message.js
Package subpath './lib/util/traverser' is not defined by "exports" in
/home/ag/Office/ecommerce/front-end/node_modules/eslint/package.json
Stack Trace and Error Report: /tmp/error.dump.a671c24c39f689554c47c73d068f7e9f.log
My Package.json:
{
"name": "front-end",
"version": "0.0.0",
"private": true,
"description": "Small description for front-end goes here",
"repository": "",
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
},
"devDependencies": {
"#ember/jquery": "^0.6.0",
"#ember/optional-features": "^0.7.0",
"broccoli-asset-rev": "^3.0.0",
"ember-ajax": "^5.0.0",
"ember-aria-tabs": "^3.0.0",
"ember-auto-import": "^1.10.1",
"ember-cli": "~3.12.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.7.3",
"ember-cli-bootstrap-4": "^0.12.0",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-flash": "^2.1.0",
"ember-cli-form-data": "^2.1.1",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^1.8.2",
"ember-cli-moment-shim": "^3.8.0",
"ember-cli-sass": "^10.0.1",
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-swiper": "^1.0.6",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-composable-helpers": "^2.4.0",
"ember-concurrency": "^1.3.0",
"ember-cp-validations": "^4.0.0-beta.12",
"ember-crumbly": "^3.0.1",
"ember-data": "~3.12.0",
"ember-drag-drop": "^0.9.0-beta.0",
"ember-export-application-global": "^2.0.0",
"ember-fetch": "^8.1.0",
"ember-font-awesome": "^4.0.0-rc.4",
"ember-load-initializers": "^2.0.0",
"ember-local-storage": "^1.7.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-modal-dialog": "^3.0.1",
"ember-moment": "^8.0.1",
"ember-pickr": "^2.2.1",
"ember-power-select": "^3.0.2",
"ember-qunit": "^4.4.1",
"ember-resize": "^0.3.4",
"ember-resolver": "^5.0.1",
"ember-source": "~3.12.0",
"ember-toggle": "^7.1.0",
"ember-tooltips": "^3.4.5",
"ember-uuid": "^2.1.0",
"ember-welcome-page": "^4.0.0",
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-node": "^9.0.1",
"loader.js": "^4.7.0",
"popper.js": "^1.16.1",
"qunit-dom": "^0.8.4",
"sass": "^1.30.0"
},
"engines": {
"node": "8.* || >= 10.*"
},
"dependencies": {
"drift-zoom": "^1.5.0"
}
}
If anyone has any idea about this error then comment or answer it. I will vote and accept the answer.
Finally, I fix my issue by downgrading the node version from 17 to 16.
I am using ember framework for my frontend application, It wors fine till last week now when I tried to build the application getting below issue,
Build failed.
Build Canceled: Broccoli Builder ran into an error with `UglifyWriter` plugin. 💥
SyntaxError: Unexpected token: name (v)
Error
at new JS_Parse_Error (eval at <anonymous> (/Users/vad/dev/book-frontend/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1545:18)
at js_error (eval at <anonymous> (/Users/vad/dev/book-frontend/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1553:11)
at croak (eval at <anonymous> (/Users/vad/dev/book-frontend/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2092:9)
at token_error (eval at <anonymous> (/Users/vad/dev/book-frontend/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2100:9)
at unexpected (eval at <anonymous> (/Users/vad/dev/content-frontend/node_modules/broccoli-uglify-sourcemap/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2106:9)
Please find the below package.json for your reference
{
"name": "book-content",
"version": "0.0.0",
"description": "Book management platform",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "ember build",
"start": "ember server",
"test": "ember test"
},
"repository": "",
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.2.0",
"broccoli-funnel": "^1.0.2",
"broccoli-merge-trees": "^1.1.1",
"bson": "^4.0.4",
"ember-ajax": "0.7.1",
"ember-aupac-typeahead": "3.1.0",
"ember-browserify": "^1.2.2",
"ember-can": "^0.8.1",
"ember-cli": "2.13.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-autocomplete-input": "1.1.0",
"ember-cli-babel": "^5.1.5",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-moment-shim": "^3.7.1",
"ember-cli-pace": "0.1.0",
"ember-cli-pagination": "2.2.2",
"ember-cli-qunit": "^1.2.1",
"ember-cli-release": "0.2.8",
"ember-cli-sass": "^7.1.7",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-composable-helpers": "2.1.0",
"ember-concurrency": "0.8.21",
"ember-data": "2.7.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-get-helper": "1.1.0",
"ember-load-initializers": "^0.5.0",
"ember-lodash": "4.17.1",
"ember-moment": "^7.8.0",
"ember-plupload": "1.13.18",
"ember-power-select-typeahead": "0.7.1",
"ember-query-params-reset": "2.0.0",
"ember-resolver": "^2.0.3",
"ember-rl-month-picker": "^0.2.0",
"ember-rl-year-picker": "^0.2.0",
"ember-slide-push-menu": "1.0.0",
"ember-truth-helpers": "1.2.0",
"ember-uploader": "1.0.0",
"ember-validations": "v2.0.0-alpha.5",
"express": "^4.13.4",
"glob": "^4.5.3",
"loader.js": "^4.0.0",
"morgan": "^1.7.0",
"uglify-js": "2.7.1"
},
"dependencies": {
"minimist": "^1.2.0"
}
}
I see some of the dependencies pulled the latest version of uglify:3.11.3 which could cause an issue but I don't know how to instruct them to use version 2.7.0 or the one which is not causing an issue. I don't know how to override nested dependency.
Could anyone please guide me to fix the issue?
Fix 1:
I have fixed the issue by adding the below code in ember-cli-build.js
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
minifyJS: {
options: {
exclude: ["**/vendor.js"]
}
}
});
But I am not sure whether it's a good solution but it resolved my issue.
There are some code which is in vendor folder is using the latest ES6 syntax which was not transpiled using babel so ember-cli-uglify can't recognize it.
Fix you have done is, ember-cli-uglify will not run for vendor folder js files. ie., it will not run minification(removing comment and doing code change for reducing file size) for those files.
I'm trying to deploy my app to Google Cloud, but I still receive error:
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
> biurovue#1.0.0 start /app
> node build/dev-server.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'chalk' .....
My app is built with nodejs, back end is in Express and Sequalizer and front end is in vuejs.
I'm calling
gcloud int
gcloud app deploy
and then, after few minutes error above occures.
I've tried several times:
npm install chalk
also, I've removed node_modules folder and call npm install from the scratch. Didn't help.
My package.json is following:
{
"name": "biurovue",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Shark <arek.shark#gmail.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js -- single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
},
"dependencies": {
"#okta/jwt-verifier": "0.0.11",
"axios": "^0.18.0",
"cors": "^2.8.4",
"each-async": "^1.1.1",
"easy-async": "^1.0.0",
"finale-rest": "^1.0.6",
"indent-string": "^4.0.0",
"sequelize": "^4.37.6",
"sqlite3": "^4.1.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuedraggable": "^2.23.0"
},
"devDependencies": {
"autoprefixer": "^7.1.5",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"chalk": "^2.4.2",
"chromedriver": "^2.33.1",
"connect-history-api-fallback": "^1.4.0",
"copy-webpack-plugin": "^4.1.1",
"cross-env": "^5.0.5",
"cross-spawn": "^5.1.0",
"css-loader": "^0.28.7",
"cssnano": "^3.10.0",
"eslint": "^4.9.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.5",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"http-proxy-middleware": "^0.17.4",
"inject-loader": "^3.0.1",
"karma": "^1.7.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.5.0",
"karma-sinon-chai": "^1.3.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.5",
"mocha": "^4.0.1",
"nightwatch": "^0.9.16",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.3.0",
"phantomjs-prebuilt": "^2.1.15",
"rimraf": "^2.6.2",
"selenium-server": "^3.6.0",
"semver": "^5.4.1",
"shelljs": "^0.7.8",
"sinon": "^4.0.1",
"sinon-chai": "^2.14.0",
"sw-precache-webpack-plugin": "^0.11.4",
"uglify-es": "^3.1.3",
"url-loader": "^0.6.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.7.1",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.19.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
What can be a problem? How to solve? diagnose errors like this?
Thanks.
Move them into dependencies. devDependencies should really only be used, as its name suggests, for development. Suppose you have a package which in turn has multiple dependencies. Suppose you are using mochaJS, chaiJS and sinonJS to achieve full test coverage. The end-user installing your package most likely wouldn't want to install the testing and/or documentation frameworks you used as well. Thus, those frameworks would be placed on devDependencies. In this case, because chalk and shellJS are required at runtime they would have to be placed in dependencies.
Summary: Use dependencies for packages required at runtime and devDependencies for packages required only to develop ( testing frameworks, linting, etc. )