Giter Club home page Giter Club logo

Comments (6)

ro0gr avatar ro0gr commented on June 5, 2024 1

Hey, thanks guys 👋

It feels reasonable for me to provide a few test scenarios to check the build against a couple of major typescript versions. Probably via ember-try scenarios...

I'll appreciate a PR! Otherwise, I'll try to take a look on a fix this weekend.

from ember-cli-page-object.

bendemboski avatar bendemboski commented on June 5, 2024 1

As I said, I'm pretty sure this has nothing to do with the typescript version, but rather using "moduleResolution": 'bundler'. I ran into this because my project uses @tsconfig/ember as the base for tsconfig.json and when I upgraded from v2 to v3 (which switches the moduleResolution) I started running into this error.

So you might be able to get a failing test by updating the test app to extend @tsconfig/ember and then have an ember-try scenario that uses v3 of @tsconfig/ember. Since this is a v2 addon, you could also just write a separate test app to test this scenario 🤷

from ember-cli-page-object.

mayatron avatar mayatron commented on June 5, 2024 1

I've opened #614 to address this. Please let me know if you have any feedback, happy to iterate on this.

Thanks @bendemboski for the tips!

from ember-cli-page-object.

bendemboski avatar bendemboski commented on June 5, 2024

Further context -- I believe this is specifically related to using "moduleResolution": 'bundler', and this patch (applied via patch-package or similar) fixes it for me:

diff --git a/node_modules/ember-cli-page-object/package.json b/node_modules/ember-cli-page-object/package.json
index cddb866..e92c917 100644
--- a/node_modules/ember-cli-page-object/package.json
+++ b/node_modules/ember-cli-page-object/package.json
@@ -25,7 +25,10 @@
   "license": "MIT",
   "author": "Santiago Ferreira",
   "exports": {
-    ".": "./dist/index.js",
+    ".": {
+      "import": "./dist/index.js",
+      "types": "./types.d.ts"
+    },
     "./*": "./dist/*",
     "./addon-main.js": "./addon-main.js"
   },

from ember-cli-page-object.

mayatron avatar mayatron commented on June 5, 2024

When I update package.json as follows:

"exports": {
  ".": {
    "import": "./dist/index.js",
    "types": "./types.d.ts"
  },
  "./*": "./dist/*",
  "./addon-main.js": "./addon-main.js"
},

... then tsc --noEmit passes, but ember build fails with the following error:

ERROR in ../../../../private/var/folders/7s/082kb7n942s1xm4t8_tpb65r0000gn/T/broccoli-20572FT45LJQ4uBmn/cache-574-webpack_bundler_ember_auto_import_webpack/tests.cjs 15:102-134
Module not found: Error: Package path . is not exported from package /private/var/folders/7s/082kb7n942s1xm4t8_tpb65r0000gn/T/broccoli-20572FT45LJQ4uBmn/cache-574-webpack_bundler_ember_auto_import_webpack/node_modules/ember-cli-page-object (see exports field in /private/var/folders/7s/082kb7n942s1xm4t8_tpb65r0000gn/T/broccoli-20572FT45LJQ4uBmn/cache-574-webpack_bundler_ember_auto_import_webpack/node_modules/ember-cli-page-object/package.json)

cleaning up...
Build Error (WebpackBundler)

webpack returned errors to ember-auto-import

However the following works for me with both tsc --noEmit and ember build.

"exports": {
  ".": {
    "import": "./dist/index.js",
    "require": "./dist/index.js",
    "types": "./types.d.ts"
  },
  "./*": {
    "import": "./dist/*",
    "require": "./dist/*",
    "types": "./types.d.ts"
  },
  "./addon-main.js": {
    "import": "./addon-main.js",
    "require": "./addon-main.js",
    "types": "./types.d.ts"
  }
},

I was able to make some progress adding a new ember-try scenario, but currently the scenario passes even without the accompanying change to package.json.

{
  name: 'ember-release-typescript-5',
  npm: {
    devDependencies: {
      '@ember/string': '^3.1.1',
      'ember-cli-typescript': '^5.2.1',
      'ember-resolver': '^10.1.1',
      'ember-source': await getChannelURL('release'),
      'typescript': '^5.1.6',
    },
  },
  env: {
    EMBER_OPTIONAL_FEATURES: JSON.stringify({
      'jquery-integration': false,
    }),
  },
}

from ember-cli-page-object.

ro0gr avatar ro0gr commented on June 5, 2024

Just published the fix https://github.com/san650/ember-cli-page-object/releases/tag/v2.1.0. Thanks everyone!

from ember-cli-page-object.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.