When you update Dreamweaver to the latest version 19.0, sometimes you get an error as "ERROR: 'document' is not defined. [no-undef]". Some of the basic JavaScript objects such as document or window are not defined.
Environment
Dreamweaver 19.0 on all supported operating systems.
Dreamweaver supports ECMAScript 6 syntax in Dreamweaver CC 19.0. Dreamweaver also supports linting of ECMAScript code, with ESLint defaulting as JavaScript linter.
In some instances, basic JavaScript objects are not defined.
"env": { "browser": true, "jquery": true }
Follow the steps in Workaround-2.
Dreamweaver now supports ECMAScript 6 syntax in Dreamweaver CC 19.0. Dreamweaver also supports linting of ECMAScript code, with ESLint defaulting as JavaScript linter.
The ESLint version supported in Dreamweaver CC 19.0 is 3.19. Some of the rules provided in .eslintrc.js configuration file such as for-direction and getter-return belong to the latest version of ESLint. Hence, this issue occurs.
This issue has been fixed by updating the .eslintrc.js configuration file. Follow the steps below to use the updated .eslintrc.js configuration file.
-
Download
-
If you have Administrator access rights, it is recommended to replace the configuration file in the installation path:
Go to <Install path>\Adobe Dreamweaver CC 2019\configuration\ESLintrc and replace the existing .eslintrc.js file with the downloaded version.
Note:
- The ECMAScript Version settings defined in site setup dialog has precedence over the .eslintrc.js file used in site root.
- If you do not have ESLint configuration files in the site, Dreamweaver searches for the configuration files in all locations leading up to the root directory.
For more information on configuration file cascading and hierarchy, see ESLint site.