OpenEnergyDashboard / OED

Open Energy Dashboard (OED)
Mozilla Public License 2.0
75 stars 263 forks source link

Do not import unused and duplicate variable name #1099

Closed hyperupcall closed 6 months ago

hyperupcall commented 10 months ago

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

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.)

Limitations

N/A

huss commented 6 months ago

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 commented 6 months ago

Agreed, this doesn't seem to be needed anymore