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

Do not import unused and duplicate variable name #1099

Conversation

hyperupcall
Copy link
Contributor

Description

As a part of the #879 work to move to Vite, this fixes an issue with imports that caused Vite to fail:

$ npm run vite:build

> open-energy-dashboard@1.0.0 vite:build
> vite --config ./src/vite.config.mjs build

vite v5.0.4 building for production...
✓ 82 modules transformed.
Identifier "localeData" has already been declared
file: /storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/src/client/app/translations/data.js:10:6
 8: 
 9: // This file used to be a json file, but had issues with importing, so we declared the json variable in a js file ins...
10: const localeData = {
          ^
11:   "en": {
12:     "3D": "3D",
error during build:
RollupError: Identifier "localeData" has already been declared
    at error (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at Module.error (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:12738:16)
    at ModuleScope.addDeclaration (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:11569:21)
    at Identifier.declare (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:7203:39)
    at VariableDeclarator.declareDeclarator (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:10179:17)
    at VariableDeclaration.initialise (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:11844:24)
    at new NodeBase (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:4607:14)
    at new VariableDeclaration (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:11816:1)
    at Program.parseNode (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:4718:27)
    at new NodeBase (file:///storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/OED/node_modules/rollup/dist/es/shared/node-entry.js:4606:14)

Related to #879

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

(Note what you have done by placing an "x" instead of the space in the [ ] so it becomes [x]. It is hoped you do all of them.)

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

N/A

@hyperupcall hyperupcall changed the title fix: Do not import unused and duplicate variable name Do not import unused and duplicate variable name Dec 5, 2023
@huss
Copy link
Member

huss commented Mar 9, 2024

This file is now data.ts and it no longer does the import from moment. It does not appear this is still needed but I seek the input of @hyperupcall to verify this as he created this PR. Thanks.

@hyperupcall
Copy link
Contributor Author

Agreed, this doesn't seem to be needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants