reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.89k stars 1.38k forks source link

[bug] Using import with assert which is deprecated #2880

Open KeM1aL opened 2 weeks ago

KeM1aL commented 2 weeks ago

Link to minimal reproducible example

-

Summary

Change the import assert syntax to import with syntax to avoid enabling deprecated feature

node_modules/@reown/appkit/dist/esm/exports/index.js: The assert keyword in import attributes is deprecated and it has been replaced by the with keyword. You can enable the deprecatedAssertSyntax: true option in the import attributes plugin to suppress this error. (2:42)

    1 | import { AppKit } from '../src/client.js';
  > 2 | import packageJson from '../package.json' assert { type: 'json' };

List of related npm package versions

"@reown/appkit": "^1.0.1"

vanyasav commented 2 days ago

Did you find a fix? @KeM1aL

rtomas commented 2 days ago

https://linear.app/reown/issue/APKT-1237/[bug]-using-import-with-assert-which-is-deprecated-in-angular

vanyasav commented 1 day ago

https://github.com/vanyasav/angular-reown-example

vanyasav commented 1 day ago
✘ [ERROR] /home/vanyasav/WebstormProjects/angular-reown-example/node_modules/@reown/appkit/dist/esm/exports/index.js: The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error. (2:42)

  1 | import { AppKit } from '../src/client.js';
> 2 | import packageJson from '../package.json' assert { type: 'json' };
    |                                           ^
  3 | import { CoreHelperUtil } from '@reown/appkit-core';
  4 | // -- Views ------------------------------------------------------------
  5 | export * from '@reown/appkit-scaffold-ui'; [plugin angular-vite-optimize-deps]

  This error came from the "onLoad" callback registered here:

    node_modules/@angular/build/src/builders/dev-server/vite-server.js:505:22:
      505 │                 build.onLoad({ filter: /\.[cm]?js$/ }, async (args) => {
          ╵                       ~~~~~~

    at setup (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/@angular/build/src/builders/dev-server/vite-server.js:505:23)
    at handlePlugins (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:699:5)
    at /home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:2032:68
    at new Promise (<anonymous>)
    at Object.context (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:2032:27)
    at Object.context (/home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/node_modules/esbuild/lib/main.js:1874:58)
    at prepareEsbuildOptimizerRun (file:///home/vanyasav/WebstormProjects/angular-reown-example/node_modules/vite/dist/node/chunks/dep-DyBnyoVI.js:50861:33)