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

Error - No "exports" main defined in /var/task/node_modules/devalue/package.json #36

Open
elron opened this issue Sep 1, 2022 · 5 comments

Comments

@elron
Copy link

elron commented Sep 1, 2022

Found duplicate: sveltejs/kit#6462

I get an error when trying to publish the latest sveltekit to netlify:
Error - No "exports" main defined in /var/task/node_modules/devalue/package.json

My Sveltekit project package.json:

        "devDependencies": {
		"@sveltejs/adapter-auto": "^1.0.0-next.71",
		"@sveltejs/kit": "next",
		"prettier": "^2.6.2",
		"prettier-plugin-svelte": "^2.7.0",
		"svelte": "^3.44.0",
		"svelte-check": "^2.7.1",
		"typescript": "^4.7.4",
		"vite": "^3.1.0-beta.1"
	},

Found more information here:
devalue import fails with adapter-node
devalue cause crash on Netlify after update

@filipkowal
Copy link

Following the suggestion:

  1. Make sure that packege.lock.json contains devalue@3.1.3 version
  2. Add devalue to noExternal array in ssr configuration in vite.config like:
const config = {
	plugins: [sveltekit()],
	ssr: {
		noExternal: ['devalue']
	}
};

@sonyarianto
Copy link

sonyarianto commented Sep 5, 2022

@filipkowal wow this solved my problem on Vercel build as well :) Thank you. My steps are.

  • Remove package-lock.json (because still contains devalue 3.1.2)
  • Remove pnpm-lock.yaml (because still contains devalue 3.1.2)
  • Run pnpm install (will create fresh pnpm-lock.yaml)
  • I do your suggestion above
  • Build on Vercel
  • Build success!

@delaneyj
Copy link

delaneyj commented Sep 7, 2022

Using straight ts-node (no vite or svelte) and hitting this same error.

pnpm-lock.yaml says

/devalue/3.1.3:
    resolution: {integrity: sha512-9KO89Cb+qjzf2CqdrH+NuLaqdk9GhDP5EhR4zlkR51dvuIaiqtlkDkGzLMShDemwUy21raSMdu+kpX8Enw3yGQ==}
    dev: false

@secondl1ght
Copy link

Should be fixed now, see here: sveltejs/kit#6462 (comment)

@W4G1
Copy link

W4G1 commented Oct 26, 2022

Same issue here on devalue 4.0.1

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

6 participants