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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: @toss/use-funnel은 next/route를 디펜던시로가지고있어서 CRA, react-route-dom, react 프로젝트에서는 사용할 수 없습니다. #402

Open
1 task done
Hansanghyeon opened this issue Dec 19, 2023 · 2 comments

Comments

@Hansanghyeon
Copy link

Hansanghyeon commented Dec 19, 2023

Package Scope

  • Add to an existing package

Package name: @toss/use-funnel

Overview

내부적으로 next/router에 의존하고 있어 nextjs를 사용하지 않은 프로젝트에서는 사용할수 없습니다.

Describe the solution you'd like

plugin 시스템으로 nextjs로 설정할수도있고 react-router-dom 또한 설정할수있는 퍼널로 되었으면 좋겠습니다.

Additional context

✘ [ERROR] Could not resolve "next/router.js"

    node_modules/@toss/use-funnel/esm/useFunnel.mjs:7:26:
      7 │ import { useRouter } from 'next/router.js';
        ╵                           ~~~~~~~~~~~~~~~~

  You can mark the path "next/router.js" as external to exclude it from the bundle, which will
  remove this error.

✘ [ERROR] Could not resolve "react-query"

    node_modules/@toss/use-funnel/esm/useFunnel.mjs:9:25:
      9 │ import { useQuery } from 'react-query';
        ╵                          ~~~~~~~~~~~~~

  You can mark the path "react-query" as external to exclude it from the bundle, which will remove
  this error.

✘ [ERROR] Could not resolve "next/router"

    node_modules/@toss/use-query-param/esm/hooks/useNextRouter.mjs:1:26:
      1 │ import { useRouter } from 'next/router';
        ╵                           ~~~~~~~~~~~~~

  You can mark the path "next/router" as external to exclude it from the bundle, which will remove
  this error.

✘ [ERROR] Could not resolve "next/router"

    node_modules/@toss/use-query-param/esm/utils/waitForRouterReady.mjs:1:19:
      1 │ import Router from 'next/router';
        ╵                    ~~~~~~~~~~~~~

  You can mark the path "next/router" as external to exclude it from the bundle, which will remove
  this error.

/root/workspace/oms-admin-v3/node_modules/@storybook/cli/bin/index.js:23
  throw error;
  ^

Error: Build failed with 4 errors:
node_modules/@toss/use-funnel/esm/useFunnel.mjs:7:26: ERROR: Could not resolve "next/router.js"
node_modules/@toss/use-funnel/esm/useFunnel.mjs:9:25: ERROR: Could not resolve "react-query"
node_modules/@toss/use-query-param/esm/hooks/useNextRouter.mjs:1:26: ERROR: Could not resolve "next/router"
node_modules/@toss/use-query-param/esm/utils/waitForRouterReady.mjs:1:19: ERROR: Could not resolve "next/router"
    at failureErrorWithLog (/root/workspace/oms-admin-v3/node_modules/esbuild/lib/main.js:1649:15)
    at /root/workspace/oms-admin-v3/node_modules/esbuild/lib/main.js:1058:25
    at /root/workspace/oms-admin-v3/node_modules/esbuild/lib/main.js:1525:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 26,
        file: 'node_modules/@toss/use-funnel/esm/useFunnel.mjs',
        length: 16,
        line: 7,
        lineText: "import { useRouter } from 'next/router.js';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: null,
          text: 'You can mark the path "next/router.js" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "next/router.js"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 25,
        file: 'node_modules/@toss/use-funnel/esm/useFunnel.mjs',
        length: 13,
        line: 9,
        lineText: "import { useQuery } from 'react-query';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: null,
          text: 'You can mark the path "react-query" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "react-query"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 26,
        file: 'node_modules/@toss/use-query-param/esm/hooks/useNextRouter.mjs',
        length: 13,
        line: 1,
        lineText: "import { useRouter } from 'next/router';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: null,
          text: 'You can mark the path "next/router" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "next/router"'
    },
    {
      detail: undefined,
      id: '',
      location: {
        column: 19,
        file: 'node_modules/@toss/use-query-param/esm/utils/waitForRouterReady.mjs',
        length: 13,
        line: 1,
        lineText: "import Router from 'next/router';",
        namespace: '',
        suggestion: ''
      },
      notes: [
        {
          location: null,
          text: 'You can mark the path "next/router" as external to exclude it from the bundle, which will remove this error.'
        }
      ],
      pluginName: '',
      text: 'Could not resolve "next/router"'
    }
  ],
  warnings: []
}
@BasixKOR
Copy link
Contributor

Duplicate of #353

@BasixKOR BasixKOR marked this as a duplicate of #353 Dec 19, 2023
@BasixKOR BasixKOR closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@BasixKOR
Copy link
Contributor

아 버그 이슈가 아니라 개선 요청이군요 일단 트래킹용으로 열어둘게요~

@BasixKOR BasixKOR reopened this Dec 19, 2023
@BasixKOR BasixKOR marked this as not a duplicate of #353 Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants