aurelia / i18n

A plugin that provides i18n support.
MIT License
93 stars 70 forks source link

Intl and i18next lookup issue with JSPM > 0.16.15 #66

Closed k2s closed 8 years ago

k2s commented 8 years ago
# jspm install aurelia-i18n
     Updating registry cache...
     Looking up npm:aurelia-i18n
     Looking up npm:Intl.js@intl
     Looking up npm:aurelia-binding
     Looking up npm:aurelia-event-aggregator
     Looking up npm:aurelia-loader
     Looking up npm:aurelia-templating
     Looking up npm:aurelia-templating-resources
     Looking up npm:aurelia-metadata
     Looking up npm:aurelia-pal
     Looking up npm:aurelia-task-queue
     Looking up npm:core-js
     Looking up npm:aurelia-logging
     Looking up npm:aurelia-path
     Looking up npm:aurelia-dependency-injection

err  Repo npm:Intl.js@intl not found!

warn Installation changes not saved.

this installs correctly: jspm install aurelia-i18n@0.4.8

EisenbergEffect commented 8 years ago

@zewa666 Please look into this asap. Apparently the npm package config is incorrect.

k2s commented 8 years ago

my temporary fix was

...
    "aurelia-i18n": "npm:aurelia-i18n@0.4.9",
...
    "npm:aurelia-i18n@0.4.9": {
      "Intl.js": "npm:intl@1.0.1",
      "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.1.2",
      "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.1.1",
      "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.1.1",
      "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.1.1",
      "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-beta.1.1.1",
      "i18next": "github:i18next/i18next@1.11.2"
    },
...
    "npm:intl@1.0.1": {
      "process": "github:jspm/nodelibs-process@0.1.2"
    },
zewa666 commented 8 years ago

I'm really not sure why this happened as it locally did work. Hmmm. Nevertheless the recent update should have fixed that hopefully. It seems that creating an Alias for NPM packages on JSPM isn't working that smoothly.

@EisenbergEffect could you give it a try and if it works create a new release? Thanks in advance

heruan commented 8 years ago

Running jspm update I now get

err  Repo npm:i18next/i18next not found!

The same running jspm install aurelia-i18n.

Jenselme commented 8 years ago

Just tested, with jspm install aurelia-i18n and it worked fine. I guess that the problem was solved. Thanks.

k2s commented 8 years ago

v0.4.10 worked for me, but I had to:

jspm uninstall aurelia-i18n
jspm install aurelia-i18n

@heruan make sure you have "jspm": "0.16.15" and not higher version

heruan commented 8 years ago

I reverted to jspm v0.16.15 (why can't we use the latest version?) and jspm update went fine, but now my application runs only on Chrome, and I get this on Safari:

Failed to load resource: /dist/Intl.js (Not Found)

and in Firefox a generic

uncaught exception: [object Object] <unknown>

What happened to Aurelia/JSPM with the latest updates?

RWOverdijk commented 8 years ago

:+1: This is still a problem here

qlayer commented 8 years ago

This is still an issue with the latest jspm beta.

EisenbergEffect commented 8 years ago

You should not be using jspm beta (0.17.x). @zewa666 Can you look into this?

qlayer commented 8 years ago

You should not be using jspm beta (0.17.x).

Does this mean that you won't be supporting 0.17 when it is released ?

zewa666 commented 8 years ago

does not happen with suggested version 0.16.15 guess that's the weird issue with the new jspm version.

Guys can you try to run npm install intl@1.0.1 and see if that fixes that issue?

qlayer commented 8 years ago

I get

err  Repo npm:i18next/i18next not found!

Even after I tried npm i i18next I did try to install i18next with jspm first and then to retain the version, but I get the same error.

zewa666 commented 8 years ago

yeah npm i18next is whole another story, as the necessary version we're using isn't available via the npm repository. So once more to get it right. With the old version of JSPM (0.16.15), and a fresh install, does the error still occur or is it only with the latest version of JSPM. If so I need to take a fresh look at it.

Souldrinker commented 8 years ago

Yes that npm:i18next/i18next not found error appears as soon as we try anything newer than jspm 0.16.15. Fixing the local jspm version to 0.16.15 fixes it, so it probably needs another look.

Souldrinker commented 8 years ago

Apart from the issue mentioned regarding i18next above we ran our app on an iPhone6 yesterday and nothing happened. So my collegue brought his private Mac to work today and now after installing xcode and stuff we could finally debug why the app wasn't working and it turned out it was due to Intl.js not being found in our app folder (where it shouldn't be).

And as far as I can see there is a mismatch between this line in aurelia-i18n.js return loader.normalize('Intl.js', i18nName) and the alias for the intl polyfill in package.json (referenced as intl).

When looking at an older app that works with aurelia-i18n 0.4.1 with a dependency to intl 0.1.4 (rather than 1.1.0) the name of the dependency was "Intl.js", that is the same as you have in your code, so I assume you either have to change in the code to "intl" or change in the package.json to "Intl.js"?

When I manually changed the key from "intl" to "Intl.js" in my config.js it started to work on the iPhone.

ehudkaldor commented 8 years ago

same here. still the same err Repo npm:i18next/i18next not found!

EisenbergEffect commented 8 years ago

What version of i18n is it trying to install?

EisenbergEffect commented 8 years ago

0.4.10 is the latest and appears to have a correct package configuration. What version of jspm are you using?

ehudkaldor commented 8 years ago
ok   Installed npm:aurelia-loader@^1.0.0-beta.1.1.0 (1.0.0-beta.1.1.1)
ok   Installed npm:aurelia-pal@^1.0.0-beta.1.1.1 (1.0.0-beta.1.1.1)
ok   Installed npm:aurelia-logging@^1.0.0-beta.1.1.1 (1.0.0-beta.1.1.1)
ok   Installed npm:aurelia-path@^1.0.0-beta.1.1.0 (1.0.0-beta.1.1.0)

warn Error on lookup for github:i18next/i18next@^1.9.0
     Error: fatal: unable to access 'i18next/i18next@^1.9.0.git/': The requested URL returned error: 400

err  Error looking up github:i18next/i18next@^1.9.0.

warn Installation changes not saved.
~/app # jspm -v
0.16.15
Running against local jspm install.
~/app # 
EisenbergEffect commented 8 years ago

It looks like the request is invalid somehow. I've confirmed that that version is present as a github release. @guybedford Any ideas why this might be happening?

ehudkaldor commented 8 years ago

and latest:

     Downloading npm:aurelia-path@1.0.0-beta.1.1.0
     Downloading npm:aurelia-fetch-client@1.0.0-beta.1.0.2
ok   Installed npm:aurelia-task-queue@^1.0.0-beta.1.1.0 (1.0.0-beta.1.1.1)
     Downloading github:aurelia/route-recognizer@0.9.0

err  Repo npm:i18next/i18next not found!

warn Installation changes not saved.
~/app # jspm -v
0.16.29
Running against local jspm install.
~/app # 
ehudkaldor commented 8 years ago

any update?

EisenbergEffect commented 8 years ago

Should be fixed. There was a release this morning.

ehudkaldor commented 8 years ago

still not working... nodejs 5.7, not stating version when installing packages.

ehudkaldor commented 8 years ago

i am using Docker to build. first, the docker image of nodejs (compiling from source):

FROM        alpine:3.3
MAINTAINER  Ehud Kaldor <ehud.kaldor@gmail.com>

ENV     NODE_VERSION v5.7.0

RUN         apk add --update curl tar gzip git python make g++ clang linux-headers binutils-gold && \
        rm -rf /var/cache/apk/*

RUN     curl sSL https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION.tar.gz > node-$NODE_VERSION.tar.gz && \
        tar -zxvf node-$NODE_VERSION.tar.gz && \
        cd node-$NODE_VERSION && \
        ./configure && \
        make && \
        make install

RUN     rm -rf node-$NODE_VERSION.tar.gz && \
        rm -rf node-$NODE_VERSION

ENV     APP_NAME application
RUN         npm install -g gulp 
RUN         npm install -g jspm  --save-dev

then, using it to create Aurelia:

FROM        ehudkaldor/nodejs:5.7.0
MAINTAINER  Ehud Kaldor <ehud.kaldor@gmail.com>

ENV     APPLICATION_NAME application

RUN     mkdir /root/$APPLICATION_NAME 

ADD             .netrc /root/.netrc
ADD     package.json /root/$APPLICATION_NAME/package.json

RUN     cd /root/$APPLICATION_NAME && \
        mkdir images styles locale src dist build static && \
        npm cache clean && \
        npm update 
RUN             cd /root/$APPLICATION_NAME && \
                npm install --save \
            aurelia-bundler
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            aurelia-tools 
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        babel 
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            del  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            vinyl-paths 
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            require-dir  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            run-sequence  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            conventional-changelog  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            browser-sync  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            karma  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        karma-babel-preprocessor
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        karma-chrome-launcher
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        karma-coverage
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        karma-jasmine
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
                        karma-jspm
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-bump  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-yuidoc  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-eslint  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-protractor  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-changed  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-babel  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-sourcemaps  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            object.assign  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-notify  
RUN             cd /root/$APPLICATION_NAME && \
             npm install --save \
            gulp-plumber  

RUN             cd /root/$APPLICATION_NAME && \
        rm -rf jspm_packages && \
        jspm cache-clear && \
        jspm update && \
        jspm install -y && \
        jspm install \
            aurelia-bootstrapper \
                        aurelia-framework \
            aurelia-logging-console \
            aurelia-fetch-client \
            aurelia-history-browser \
            aurelia-loader-default \
            aurelia-router \
            aurelia-templating-binding \
            aurelia-templating-resources \
            aurelia-templating-router \
            npm:aurelia-i18n \
            aurelia-animator-css \
            semantic-ui \ 
            font-awesome \
            fetch \
            text 

ADD     build /root/$APPLICATION_NAME/build/
ADD     index.js index.html gulpfile.js /root/$APPLICATION_NAME/

RUN     rm -rf /root/.netrc 

and still getting the "i18next not found" error on trying to install aurelia-i18n