vixnguyen / timezone-select

15 stars 2 forks source link

✘ [ERROR] Could not resolve "crawler" #6

Closed Crypto69 closed 3 months ago

Crypto69 commented 8 months ago

Tried to use this in a vue 3 application. I have"version": "2.0.0" installed using npm

✘ [ERROR] Could not resolve "crawler"

    node_modules/timezone-select-js/crawler.js:5:24:
      5 │ const Crawler = require('crawler');
        │                         ~~~~~~~~~
        ╵                         "./crawler"

  Use the relative path "./crawler" to reference the file
  "node_modules/timezone-select-js/crawler.js". Without the leading "./", the path "crawler" is
  being interpreted as a package path instead.

2:30:05 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/timezone-select-js/crawler.js:5:24: ERROR: Could not resolve "crawler"

I get the error above. I'll get the error by just including the file without even trying to access any of the functions.

Here is my code that causes error.

<script>
import { defineComponent } from "vue";
import useAuthUser from "src/composables/UseAuthUser";
import { ref } from "vue";
import { listTz, clientTz } from "timezone-select-js";

export default defineComponent({
  name: "PageMe",

  setup() {
    const { user } = useAuthUser();

    return {
      user,
    };
  },
});
</script>
atymic commented 5 months ago

Same issue here

tanitna commented 4 months ago

It's a missing dependency.

npm install crawler

vixnguyen commented 3 months ago

You guys can use version 1.0.3 instead. I'll fix version 2 soon.

vixnguyen commented 3 months ago

Fixed already. Please check out v2.0.1.