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

ESLint errors: [react-javascript] 'define' is not defined no-undef/or no-unused-expressions #36

Closed
arpitprod opened this issue Aug 6, 2018 · 9 comments
Labels
bug Something isn't working

Comments

@arpitprod
Copy link

I forked this repo and add one more page
https://github.com/arpitprod/charting-library-react

First open index page, Chart will show
then on Index page, click on 'AnotherPage' link and open another page
then click on 'GoToIndexPage' link and page will move to index page again

but chart will not show now

@timocov
Copy link
Contributor

timocov commented Aug 7, 2018

Your repo is not fork 🙂

But anyway - see my fixes in #38. I hope it should help you.

Related to https://github.com/tradingview/charting_library/issues/3162

@timocov timocov added the bug Something isn't working label Aug 7, 2018
@arpitprod
Copy link
Author

arpitprod commented Aug 7, 2018

thanks, thats working now

in commit a5a5e3f, where you copied charting_library/ directory

When I copied charting_library/ directory in public/ directory then react shows this error message

Module not found: You attempted to import ../../charting_library/charting_library.min which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/.

and when I copied charting_library/ directory in src/ directory then react shows this error message

Failed to compile.

./src/charting_library/charting_library.min.js
Line 1: 'define' is not defined no-undef
Line 1: 'define' is not defined no-undef
Search for the keywords to learn more about each error.

@timocov
Copy link
Contributor

timocov commented Aug 7, 2018

Failed to compile.

You need to add this file (./src/charting_library/charting_library.min.js) and all other CL files to ESLint (and any other linters you use) ignore. I do not know way to do it with react-create-app (it is awful), but you can /* eslint-disable */ at the top of the file to ignore this error.

@BStephenBB
Copy link

BStephenBB commented Apr 9, 2019

It would be really helpful if this ESlint tip was in the readme for the demo react project; I had the same issue with getting the example project to work; if you follow the instructions as is I believe this error will always occur. I can make a PR if that would help.

@timocov
Copy link
Contributor

timocov commented Apr 10, 2019

I can make a PR if that would help.

👍 feel free to make it.

@timocov
Copy link
Contributor

timocov commented Apr 16, 2019

@Yadnyesh-Tecx
Copy link

Geeting error please help someone
src\charting_library\charting_library.esm.js
Line 1:1475: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:1890: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:2567: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:3996: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:6237: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:6317: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:6574: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:8030: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 1:11060: Expected an assignment or function call and instead saw an expression no-unused-expressions

Search for the keywords to learn more about each error.

@timocov timocov changed the title react-javascript: 'define' is not defined no-undef ESLint errors: [react-javascript] 'define' is not defined no-undef/or no-unused-expressions Dec 10, 2021
@Southbig
Copy link

Southbig commented Dec 4, 2023

Geeting error please help someone src\charting_library\charting_library.esm.js Line 1:1475: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:1890: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:2567: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:3996: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:6237: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:6317: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:6574: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:8030: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1:11060: Expected an assignment or function call and instead saw an expression no-unused-expressions

Has anyone solved the above error?

So how to solve it?

help me ..

스크린샷 2023-12-05 오전 12 10 15

@xlorne
Copy link

xlorne commented Dec 10, 2023

@Southbig only add /* eslint-disable */ code ./src/charting_library/charting_library.esm.js at the top of the file to ignore this error.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants