I just have some of problem here at my scss files at any parts of my folder wherein it doesn't work anymore and I don't understand why..I tried to research it but I couldn't find the same error that I have?
Its on my react or any normal html in my react I already install it my package.json
{
"name": "my-messages",
"version": "0.1.0",
"private": true,
"dependencies": {
"#reduxjs/toolkit": "^1.8.6",
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^13.4.0",
"#testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.2",
"emoji-picker-react": "^4.4.5",
"firebase": "^9.12.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.4",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"redux": "^4.2.0",
"sass": "^1.55.0",
"uuid": "^9.0.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
And here in the image as you see its not working anymore..
I didn't touch anything that changes on my terminal or does the SCSS changes???
Here is my bottom right corner thing
Maybe the location of CSS file is changed.
Invalid CSS format.
Try a different browser.
Related
This is the error:
SyntaxError: Unexpected token } in JSON at position 322. But JSON file
is correct.
JSON file:
{
"name": "gl",
"version": "1.0.0",
"description": "GL online CV",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Alex Guzhyk",
"license": "ISC",
"dependencies": {
"express": "^4.16.2",
"react": "^16.1.1",
"react-dom": "^16.1.1",
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"webpack": "^3.8.1",
}
}
Validate your JSON to know if the format is correct.
Remove the trailing comma at the end of the collection.
{
"name": "gl",
"version": "1.0.0",
"description": "GL online CV",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Alex Guzhyk",
"license": "ISC",
"dependencies": {
"express": "^4.16.2",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"webpack": "^3.8.1"
}
}
You can check it here:
https://jsonlint.com/
In JSON, you can not have a trailing comma.
Incorrect usage
"person": {
"age": 31,
"gender": "male",
}
Unlike javascript, JSON is a strict data format which is not javascript! It has only been derived from it.
Therefore in JSON, you are not allowed to add a trailing comma.
Correct usage
"person": {
"age": 31,
"gender": "male"
}
I am trying to build some tests that i have on my code, but i am not able to run it because it does not recognize the import statements.
when I run "npm test" to check my tests, i receive this error:
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import React from 'react'
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-cli/node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at <anonymous>
These are my .babelrc and package.json files:
package.json:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"dev": "^0.1.3",
"react": "^15.6.1",
"react-google-button": "^0.3.0",
"react-google-login": "^2.9.2",
"react-google-login-component": "^0.7.0",
"react-native-google-signin": "^0.10.0",
"react-redirect": "^1.0.0",
"react-router-dom": "^4.1.2",
"react-scripts": "0.9.5"
},
"devDependencies": {
"babel-jest": "^20.0.3",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
"enzyme": "^2.9.1",
"enzyme-to-json": "^1.5.1",
"identity-obj-proxy": "^3.0.0",
"jest-cli": "^20.0.4",
"react-addons-test-utils": "^15.6.0",
"react-dom": "^15.6.1"
},
"jest": {
"transform": {}
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest",
"eject": "react-scripts eject"
}
}
.babelrc:
{
"plugins":["transform-react-jsx"],
"presets": ["es2015", "react"],
"env": {
"test": {
"plugins": ["transform-es215-modules-commonjs"]
}
}
}
I want to include this extension ol3-layerswitcher on my package.json file
My package.json:
{
"name": "TEST",
"version": "1.0.0",
"description": "OpenLayers 3",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "beefy app.js:bundle.js --live",
"compile:dev": "./node_modules/.bin/browserify app.js -o bundle.js",
"compile:prod": "./node_modules/.bin/browserify app.js | uglifyjs > bundle.js"
},
"author": "test",
"license": "MIT",
"dependencies": {
"jquery": "^3.1.0",
"jquery-ui": "^1.12.0",
"openlayers": "^3.17.1",
"ol3-layerswitcher": "^1.0.2"
},
"devDependencies": {
"browserify": "^13.0.0",
"uglify-js": "^2.7.0",
"beefy": "^2.1.8"
}
}
add this line :
"dependencies": {
"jquery": "^3.1.0",
"jquery-ui": "^1.12.0",
"ol3-layerswitcher": "git://github.com/walkermatt/ol3-layerswitcher.git",
"openlayers": "^3.17.1"
}
I noticed that when viewing a package.json under node_modules, I see JSON that looks like:
{
"_args": [
[
"example#0.2.0",
"C:\\path\\to\\project\\folder"
]
],
"_from": "example#0.2.0",
"_id": "example#0.2.0",
"_inCache": true,
"_installable": true,
"_location": "/example",
"_nodeVersion": "6.2.0",
"_npmUser": {},
"_npmVersion": "3.8.9",
"_phantomChildren": {},
"_requested": {
"name": "example",
"raw": "example#0.2.0",
"rawSpec": "0.2.0",
"scope": "#edf",
"spec": "0.2.0",
"type": "version"
},
"_requiredBy": [
"/"
],
"_resolved": "http://internal.registry/example/-/example-0.2.0.tgz",
"_shasum": "b564b263db925ff3a8bffdc922c16f8e4b6f4641",
"_shrinkwrap": null,
"_spec": "example#0.2.0",
"_where": "C:\\path\\to\\project\\folder",
"author": {
"name": "NPM User"
},
"dependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0"
},
"description": "Example Package",
"devDependencies": {},
"dist": {
"shasum": "b564b263db925ff3a8bffdc922c16f8e4b6f4641",
"tarball": "http://internal.registry/example/-/example-0.2.0.tgz"
},
"main": "index.js",
"name": "example",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"readmeFilename": "README.md",
"scripts": {
"postinstall": "gulp"
},
"version": "0.2.0"
}
Instead of just:
{
"name": "example",
"version": "0.2.0",
"description": "Example Package",
"main": "index.js",
"scripts": {
"postinstall": "gulp"
},
"author": "NPM User",
"dependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0"
}
}
Is there a command-line argument I can specify to keep dependency package.json files as authored when installing, or is there another way I can access the file as authored when there is no repository specified for the package?
I found an option called proprietary-attribs on the npm-config documentation but I don't think that's what I'm looking for.
I am using gulpfile.js but it is throwing compile time error for gulp-notify
Following is structure of package.json
{
"name": "flux-pricing",
"version": "0.0.1",
"description": "Pricing component with flux",
"main": "gulpfile.js",
"dependencies": {
"flux": "^2.0.0",
"react": "^0.12.0",
"underscore": "^1.7.0"
},
"devDependencies": {
"envify": "~1.2.1",
"browserify": "~4.2.0",
"gulp": "~3.9.0",
"gulp-notify": "~1.4.0",
"gulp-util": "~2.2.19",
"reactify": "~0.13.1",
"vinyl-source-stream": "~0.1.1",
"watchify": "~0.10.2"
},
"scripts": {
"start": "watchify -o js/bundle.js -v -d .",
"build": "browserify . | uglifyjs -cm > js/bundle.min.js"
},
"author": "Ken Wheeler",
"browserify": {
"transform": [
"reactify",
"envify"
]
}
}