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

TypeError: flareSourcemapUploader is not a function #4

Closed
glennmichael123 opened this issue Mar 23, 2023 · 9 comments
Closed

TypeError: flareSourcemapUploader is not a function #4

glennmichael123 opened this issue Mar 23, 2023 · 9 comments
Assignees

Comments

@glennmichael123
Copy link

glennmichael123 commented Mar 23, 2023

When I tried using this function inside the plugin it throws this error

failed to load config from vite.config.ts error when starting dev server: TypeError: flareSourcemapUploader is not a function at vite.config.ts.timestamp-1679534839280.mjs:37:5 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) ELIFECYCLE  Command failed with exit code 1.

Here is the code in question:

import flareSourcemapUploader from '@flareapp/vite-plugin-sourcemap-uploader'

export default defineConfig({
resolve: {
   alias: {
     '~/': `${path.resolve(__dirname, 'src')}/`,
   },
 },
clearScreen: false,

server: {
    port: 3333,
    strictPort: true,
},
plugins: [
    flareSourcemapUploader({
      key: loadEnv('mock', process.cwd(), '').VITE_FLAREAPP_KEY,
    })
]
pnpm version: 7.30.0
node version: v18.15.0
vite version: ^4.1.2
@rswfire
Copy link

rswfire commented May 13, 2023

I have this same issue.

@vc-ryan
Copy link

vc-ryan commented Jun 8, 2023

Same issue here, anyone have a solution?
Logging shows it is a function { default: [Function: flareSourcemapUploader] }.

@Sam-Apostel Sam-Apostel self-assigned this Aug 3, 2023
@a4anthony
Copy link

This worked for me.

flareSourcemapUploader.default({ key: "Public key here" })

@chrispage1
Copy link

Same issue! Thanks to @a4anthony for a workaround

@Sam-Apostel
Copy link
Contributor

This issue indicates a problem with our build step. using .default is a workaround at best, which might not work after building your project to a different target and isn't compatible with typescript types.

I'll look into finding a more reliable package building tool.

@Sam-Apostel Sam-Apostel reopened this Sep 26, 2023
@glennmichael123
Copy link
Author

@Sam-Apostel Thank you for looking into this as this issue has swayed me from using Flare with Vite configs.

@salvisb
Copy link

salvisb commented Oct 23, 2023

The same here. @Sam-Apostel do we have an ETA on a proper fix? Thanks!

@yo-mike
Copy link

yo-mike commented Dec 3, 2023

Hello -- I ran into this today, too:

TypeError: flareSourcemapUploader is not a function.

I'm using Vite. Here's my package.json:

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.6",
        "@tailwindcss/typography": "^0.5.10",
        "alpinejs": "^3.10.5",
        "autoprefixer": "^10.4.16",
        "axios": "^0.25",
        "jquery-ui": "^1.13.2",
        "laravel-mix": "^6.0.6",
        "laravel-vapor": "^0.6.0",
        "laravel-vite-plugin": "^0.7.8",
        "lodash": "^4.17.19",
        "postcss": "^8.4.31",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^3.3.3",
        "tippy.js": "^6.3.7",
        "vite": "^4.4.9"
    },
    "dependencies": {
        "@flareapp/flare-client": "^3.0.5",		// 👈
        "@flareapp/vite-plugin-sourcemap-uploader": "^1.0.3", // 👈
        "bootstrap-select": "^1.13.18",
        "medium-editor": "^5.23.3",
        "tw-elements": "^1.0.0-beta2"
    },
    "description": "```bash\r cp .env.example .env",
    "version": "1.0.0",
    "main": "tailwind.config.js",
    "directories": {
        "test": "tests"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
}

I'm using flareSourcemapUploader.default({ key: "Public key here" }) as a workaround for now.

@spatie-bot
Copy link

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

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

10 participants