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

Could not resolve "./components/FocusPoint" #9

Closed
jasperf opened this issue May 18, 2023 · 3 comments
Closed

Could not resolve "./components/FocusPoint" #9

jasperf opened this issue May 18, 2023 · 3 comments

Comments

@jasperf
Copy link

jasperf commented May 18, 2023

Using this package in a Laravel Vue app. Updating from Laravel Mix now to Viet with our Vue 2. Now stuck at Could not resolve "./components/FocusPoint":

npm run dev

> dev
> vite


  VITE v3.2.6  ready in 716 ms

  ➜  Local:   http://127.0.0.1:5173/
  ➜  Network: use --host to expose

  LARAVEL v9.52.7  plugin v0.6.1

  ➜  APP_URL: https://site.test
✘ [ERROR] Could not resolve "./components/FocusPoint"

    node_modules/vue-focuspoint-component/src/index.js:1:23:
      1 │ import FocusPoint from './components/FocusPoint'
        ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/user/code/site.com/node_modules/esbuild/lib/main.js:1575
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
node_modules/vue-focuspoint-component/src/index.js:1:23: ERROR: Could not resolve "./components/FocusPoint"
    at failureErrorWithLog (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:1575:15)
    at /Users/user/code/site.com/node_modules/esbuild/lib/main.js:1033:28
    at runOnEndCallbacks (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:1447:61)
    at buildResponseToResult (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:1031:7)
    at /Users/user/code/site.com/node_modules/esbuild/lib/main.js:1143:14
    at responseCallbacks.<computed> (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:680:9)
    at handleIncomingPacket (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:735:9)
    at Socket.readFromStdout (/Users/user/code/site.com/node_modules/esbuild/lib/main.js:656:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 23,
        file: 'node_modules/vue-focuspoint-component/src/index.js',
        length: 25,
        line: 1,
        lineText: "import FocusPoint from './components/FocusPoint'",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Could not resolve "./components/FocusPoint"'
    }
  ],
  warnings: []
}

We use it in the Laravel Mediamanager loading it using

// resources/assets/vendor/MediaManager/js/components/utils/upload-preview.vue
...
<script>
import cloneDeep from 'lodash/cloneDeep'
import FocusPoint from 'vue-focuspoint-component'

export default {
    components: {
        FocusPoint
    },
    props: [
        'file',
        'fileTypeIs',
        'trans'
    ],
...

so we do use import ES2015 already. We also installed it of course:

npm list vue-focuspoint-component
site.com@ /Users/user/code/site.com
└── vue-focuspoint-component@2.0.1
```Any ideas what we might be missing here?
@jasperf
Copy link
Author

jasperf commented May 18, 2023

It seems we need import FocusPoint from './components/FocusPoint.vue' in node_modules/vue-focuspoint-component/src/index.js with .vue extension.

@EvodiaAut
Copy link
Owner

did it work now?

@jasperf
Copy link
Author

jasperf commented May 19, 2023

@EvodiaAut Yeah, will close this thread now

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