You are running into a quirk in the type system. The haskell standard says that sub expressions in where clauses that have type annotations with variables in them (pack'), the variables are not the same as the variables in the toplevel expression (pack). When you wrote this code, haskell inferred a type of pack :: (Eq a1) => [a1] -> [[a1]], and then pack' is correctly the type pack' :: [a] -> [[a]], but that a1 and that a are different types as far as ghc is concerned. But based on how they are used, ghc says no, they should be the same type, ERROR FIX IT. Even if you specify a type for pack that uses "a", the problem still persists because they are still considered different a's.
There are two ways to fix this. First one is just remove the type info from pack'. Just remove that line and ghc will infer all the types correctly and you can get on with your day.
The other way is to use the ScopedTypeVariables extension, which everyone generally loves and uses when they need it. It has a niggle where it requires a forall for each type variable in the overall type, but from that point on it works the way you would expect.
{-# LANGUAGE ScopedTypeVariables #-}
pack :: forall a. (Eq a) => [a] -> [[a]]
pack xs = pack' xs
where
pack' :: [a] -> [[a]]
pack' [] = []
pack' (x:y) = extra x xs ++ pack' y