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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in build env when trying to use json in Javascript #1181

Closed
5 tasks done
NathanAP opened this issue Sep 27, 2022 · 1 comment
Closed
5 tasks done

Problem in build env when trying to use json in Javascript #1181

NathanAP opened this issue Sep 27, 2022 · 1 comment
Labels
Status: Review Needed Request for review comments

Comments

@NathanAP
Copy link

NathanAP commented Sep 27, 2022

This is a repost of this, I didn't notice I posted on 2.x while I was using 3.x, my bad 馃槶

Original post:

Reporting a bug?

Hi! I'm not sure if this is the right way to talk about my situation. I'm really sorry if it isn't.

I have a file which contains my locale data, one of them contains something like this:

{ 
   "translateList": {
      "type": {
         "title": "Tipo",
         "position": 2,
         "attribute": "types"
      }
   }
}

I'm trying to use vue-i18n programatically in my app, directly in Javascript. As you can see in the first image, when I run in dev, I have that source data which contains the key that I need, so if I do attribute.source, I get types, awesome.

Screenshot_2

The problem is that when I use npm run build, that attribute changes to the second image and I no longer have the source data, so my attribute.source is now undefined as you can see in the second image here:

Screenshot_3

How can I get that "types" value that is specified in "attribute" key?

Expected behavior

I feel that .source should keep sending us the same data in build and dev.

Reproduction

I have no data ):

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-9700KF CPU @ 3.60GHz
    Memory: 6.83 GB / 15.92 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 105.0.5195.102
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.42)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @intlify/vite-plugin-vue-i18n: ^6.0.1 => 6.0.1
    @vitejs/plugin-basic-ssl: ^0.1.2 => 0.1.2
    @vitejs/plugin-vue: ^3.0.3 => 3.0.3
    vite: ^3.0.5 => 3.0.9
    vite-plugin-vuetify: ^1.0.0-alpha.12 => 1.0.0-alpha.14
    vue: ^3.2.37 => 3.2.37
    vue-advanced-cropper: ^2.8.3 => 2.8.3
    vue-axios: ^3.4.1 => 3.4.1
    vue-cli-plugin-vuetify: ~2.5.4 => 2.5.4
    vue-i18n: ^9.2.2 => 9.2.2
    vue-router: ^4.1.4 => 4.1.4
    vuetify: ^3.0.0-beta.0 => 3.0.0-beta.9
    vuetify-loader: ^2.0.0-alpha.0 => 2.0.0-alpha.9

Screenshot

No response

Additional context

No response

Validations

Copy link
Member

kazupon commented Nov 15, 2022

Close in-activity

We need a solution to this issue, but we need the minimue reproduction code that can actually confirm the issue with anyone. we need a github repo or stackbliz where anyone can reproduce the issue.
If you would be faced this issue agina, please you would open the new issue.
thanks!

@kazupon kazupon closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

2 participants