surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.09k stars 795 forks source link

fail to run react test examples #7162

Open hanqitech opened 10 months ago

hanqitech commented 10 months ago

Are you requesting a feature, reporting a bug or asking a question?

report a bug

What is the current behavior?

When I try to run test examples for React ,I got error messages and blank page. These are error messages: Failed to load resource: the server responded with a status of 404 (Not Found) 127.0.0.1/:1 Refused to execute script from 'http://127.0.0.1:7777/build/survey-react-ui/survey-react-ui.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. (索引):55 Live reload enabled. index.js:1054 Uncaught ReferenceError: SurveyReact is not defined at init (eval at transform.run (browser.js:5740:10), <anonymous>:752:39) at eval (eval at transform.run (browser.js:5740:10), <anonymous>:756:3) at transform.run (browser.js:5740:50) at exec (browser.js:5795:21) at browser.js:5811:9 at xhr.onreadystatechange (browser.js:5767:21) This is screen shot of blank page :

截屏2023-10-16 22 16 13

What is the expected behavior?

The page should contain a survey just as Vue example.

How would you reproduce the current behavior (if this is a bug)?

Just run npm start

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

your_code_here

Specify your

Besides ,I already figure out how to fix it ,just change two lines of code in survey-library/examples/react/index.js and examples/react/index.html, Could I open a pull requests to fix it?

andrewtelnov commented 10 months ago

@hanqitech Sure, you can make a PR.

Thank you, Andrew

tsv2013 commented 10 months ago

Unfotrunately you've changed examples to use the legacy versions of SurveyJS libraries. The examples should use survey-core + survey-knockout-ui or survey-core + survey-react-ui libraries. To get them you neef to run the npm run build command.